diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8dd6287..9baa775 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,15 @@ repos: - repo: https://github.com/charliermarsh/ruff-pre-commit # Ruff version. - rev: 'v0.0.254' + rev: "v0.2.1" hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] - - repo: https://github.com/psf/black - rev: 22.3.0 - hooks: - - id: black - language_version: python3 + args: [--fix] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - - id: check-merge-conflict - - id: mixed-line-ending + - id: check-merge-conflict + - id: mixed-line-ending #- repo: https://github.com/pycqa/bandit # rev: 1.7.4 # hooks: @@ -23,4 +18,4 @@ repos: - repo: https://github.com/Lucas-C/pre-commit-hooks-safety rev: v1.3.1 hooks: - - id: python-safety-dependencies-check \ No newline at end of file + - id: python-safety-dependencies-check diff --git a/pyproject.toml b/pyproject.toml index 44e4d37..b492563 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,101 +20,66 @@ python = "^3.10" [tool.poetry.group.dev.dependencies] pre-commit = "^2.20.0" pytest = "^7.2.0" -# ruff = "^0.0.254" tox = "^4.4.8" [tool.ruff] -select = [ - "A", - "ANN", - "ARG", - "B", - "C", - "COM", - "C90", - "E", - "ERA", - "F", - "I", - "N", - "PGH", - "PL", - "PLE", - "PLR", - "PLW", - "PT", - "PTH", - "Q", - "RET", - "RUF", - "SLF", - "SIM", - "TID", - "TRY", - "UP", - "W", - "YTT", -] -ignore = ["A003", "ANN101", "ANN401", "N805", "N818", "PLR0913", "RET504", "RET505"] +# Same as Black. +line-length = 96 +target-version = "py310" -fixable = [ - "A", - "ANN", - "ARG", - "B", - "C", - "COM", - "C90", - "E", - "ERA", - "F", - "I", - "PGH", - "PL", - "PLE", - "PLR", - "PLW", - "PT", - "PTH", - "Q", - "RET", - "RUF", - "SLF", - "SIM", - "TID", - "TRY", - "UP", - "W", - "YTT", -] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F", "B"] +ignore = ["E501"] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] unfixable = [] +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + exclude = [ ".bzr", ".direnv", ".eggs", ".git", + ".git-rewrite", ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", ".pants.d", + ".pyenv", + ".pytest_cache", ".pytype", ".ruff_cache", + ".svn", ".tox", ".venv", + ".vscode", "__pypackages__", "_build", "buck-out", "build", "dist", + "node_modules", + "site-packages", "venv", - "pages", - "tests" ] -line-length = 96 - -dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" - -target-version = "py310" - [tool.ruff.mccabe] max-complexity = 10