diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5cc09ef..d25d82d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,15 +13,12 @@ repos: - id: fix-byte-order-marker - id: mixed-line-ending - id: trailing-whitespace - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.11.0 - hooks: - - id: black - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] + args: [--fix] + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.7.1 hooks: diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 64917c4..5da1937 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,7 +2,6 @@ "recommendations": [ "ms-python.python", "ms-python.vscode-pylance", - "ms-python.black-formatter", "ms-python.mypy-type-checker", "charliermarsh.ruff", ] diff --git a/.vscode/settings.json b/.vscode/settings.json index 1e36126..e7aa6bd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "python.analysis.autoImportCompletions": true, "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", + "editor.defaultFormatter": "charliermarsh.ruff", "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll.ruff": "explicit", diff --git a/CHANGELOG.md b/CHANGELOG.md index 47ceb80..96cbdd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed `glob_scanner()` and `glob_filter()` functions. +### Documentation + +- Removed `black` badge from documentation. + ### Linting - Removed `pyupgrade`. +- Removed `black`. +- Adopted `ruff format`. ### Testing diff --git a/pyproject.toml b/pyproject.toml index 344d239..94bc736 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,8 +55,6 @@ docs = [ "sphinx-copybutton>=0.5", ] lint = [ - # https://black.readthedocs.io/en/stable/ - "black>=23.11", # https://docs.astral.sh/ruff/ "ruff>=0.1.6", # https://mypy.readthedocs.io/en/stable/ @@ -124,8 +122,8 @@ HYPOTHESIS_STORAGE_DIRECTORY = "{root}{/}.cache{/}hypothesis" [tool.hatch.envs.default.scripts] docs = "python {root}{/}docs{/}release.py {args}" lint = [ - "black {root}{/}src {root}{/}tests", - "ruff {root}{/}src {root}{/}tests", + "ruff check {root}{/}src {root}{/}tests", + "ruff format {root}{/}src {root}{/}tests", "mypy {root}{/}src {root}{/}tests", ] test = [ @@ -134,10 +132,6 @@ test = [ "python -m coverage report", ] -[tool.black] -line-length = 120 -target-version = ["py39"] - [tool.ruff] line-length = 120 target-version = "py39" @@ -146,27 +140,29 @@ src = ["src"] show-fixes = true show-source = true select = [ - "F", # pyflakes - "E", # pycodestyle error - "W", # pycodestyle warning - "D3", # pydocstyle - "PLE", # pylint error - "PLW", # pylint warning - "YTT", # flake8-2020 - "BLE", # flake8-blind-except - "FBT", # flake8-boolean-trap - "B", # flake8-bugbear - "C4", # flake8-comprehensions - "ISC", # flake8-implicit-str-concat - "ICN", # flake8-import-conventions - "PIE", # flake8-pie - "PT", # flake8-pytest-style - "SIM", # flake8-simplify - "TCH", # flake8-type-checking - "FLY", # flynt - "I", # isort - "PGH", # pygrep-hooks - "UP", # pyupgrade + "F", # pyflakes + "E", # pycodestyle error + "W", # pycodestyle warning + "D3", # pydocstyle + "PLE", # pylint error + "PLW", # pylint warning + "YTT", # flake8-2020 + "BLE", # flake8-blind-except + "FBT", # flake8-boolean-trap + "B", # flake8-bugbear + "COM818", # flake8-commas + "C4", # flake8-comprehensions + "ISC003", # flake8-implicit-str-concat + "ICN", # flake8-import-conventions + "PIE", # flake8-pie + "PT", # flake8-pytest-style + "RSE", # flake8-raise + "SIM", # flake8-simplify + "TCH", # flake8-type-checking + "FLY", # flynt + "I", # isort + "PGH", # pygrep-hooks + "UP", # pyupgrade "RUF", ] ignore = [ diff --git a/tox.ini b/tox.ini index 7d26f65..ce433e2 100644 --- a/tox.ini +++ b/tox.ini @@ -30,8 +30,8 @@ commands = extras = lint commands = - black {toxinidir}{/}src {toxinidir}{/}tests - ruff --cache-dir={envdir}{/}.cache{/}ruff {toxinidir}{/}src {toxinidir}{/}tests + ruff check --cache-dir={envdir}{/}.cache{/}ruff {toxinidir}{/}src {toxinidir}{/}tests + ruff format --cache-dir={envdir}{/}.cache{/}ruff {toxinidir}{/}src {toxinidir}{/}tests mypy --cache-dir={envdir}{/}.cache{/}mypy {toxinidir}{/}src {toxinidir}{/}tests [testenv:docs]