From 5a4c54b9275cc08bba369baac5ff56dedaee0484 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 21 Dec 2023 10:57:37 +0000 Subject: [PATCH 1/3] all ruff --- Makefile | 11 ++++------- pyproject.toml | 21 +++------------------ tests/requirements-linting.txt | 6 +----- 3 files changed, 8 insertions(+), 30 deletions(-) diff --git a/Makefile b/Makefile index 5709b44..868ce68 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,4 @@ .DEFAULT_GOAL := all -isort = isort rtoml tests -black = black rtoml tests install: pip install -U pip wheel pre-commit @@ -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: diff --git a/pyproject.toml b/pyproject.toml index ca0cff3..e3056aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/requirements-linting.txt b/tests/requirements-linting.txt index 594e1b1..9ee90ca 100644 --- a/tests/requirements-linting.txt +++ b/tests/requirements-linting.txt @@ -1,6 +1,2 @@ -black==22.3.0 -ruff==0.0.108 -isort[colors]==5.10.1 +ruff==0.1.8 mypy==0.950 -pycodestyle==2.8.0 -pyflakes==2.4.0 From e473aa189c5fb6a79714da6f231c50276de3ad29 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 21 Dec 2023 11:47:10 +0000 Subject: [PATCH 2/3] format --- tests/toml_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/toml_test.py b/tests/toml_test.py index 235752d..f8bdbc5 100755 --- a/tests/toml_test.py +++ b/tests/toml_test.py @@ -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() From db9de8e95535b9ea471c3353156d09107d59568e Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 21 Dec 2023 11:48:19 +0000 Subject: [PATCH 3/3] uprev mypy --- tests/requirements-linting.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements-linting.txt b/tests/requirements-linting.txt index 9ee90ca..c13e54a 100644 --- a/tests/requirements-linting.txt +++ b/tests/requirements-linting.txt @@ -1,2 +1,2 @@ ruff==0.1.8 -mypy==0.950 +mypy==1.7.1