Skip to content

Commit

Permalink
all ruff (#71)
Browse files Browse the repository at this point in the history
* all ruff

* format

* uprev mypy
  • Loading branch information
samuelcolvin committed Dec 21, 2023
1 parent 1d12b90 commit 3428cd8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 32 deletions.
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.DEFAULT_GOAL := all
isort = isort rtoml tests
black = black rtoml tests

install:
pip install -U pip wheel pre-commit
Expand All @@ -22,16 +20,15 @@ build-prod:

.PHONY: format
format:
$(isort)
$(black)
ruff check --fix-only rtoml tests
ruff format rtoml tests
cargo fmt


.PHONY: lint-python
lint-python:
ruff src tests
$(isort) --check-only --df
$(black) --check --diff
ruff check rtoml tests
ruff format --check rtoml tests

.PHONY: lint-rust
lint-rust:
Expand Down
21 changes: 3 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,10 @@ exclude_lines = [

[tool.ruff]
line-length = 120
extend-select = ["Q"]
extend-select = ["Q", "RUF100", "UP", "I"]
flake8-quotes = {inline-quotes = "single", multiline-quotes = "double"}

[tool.black]
color = true
line-length = 120
target-version = ["py37", "py38", "py39", "py310"]
skip-string-normalization = true
skip-magic-trailing-comma = true

[tool.isort]
line_length = 120
known_first_party = ["rtoml"]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
color_output = true
skip = "tests/toml_test.py"
format.quote-style="single"
target-version = "py38"

[tool.mypy]
follow_imports = "normal"
Expand Down
8 changes: 2 additions & 6 deletions tests/requirements-linting.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
black==22.3.0
ruff==0.0.108
isort[colors]==5.10.1
mypy==0.950
pycodestyle==2.8.0
pyflakes==2.4.0
ruff==0.1.8
mypy==1.7.1
2 changes: 1 addition & 1 deletion tests/toml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# via `~/go/bin/toml-test ./tests/toml_test.py`
import json
import sys
from datetime import datetime, date, time
from datetime import date, datetime, time
from pathlib import Path

ROOT_DIR = (Path(__file__).parent / '..').resolve()
Expand Down

0 comments on commit 3428cd8

Please sign in to comment.