diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ed8540..dabe103 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,19 +33,14 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace -# Black, the code formatter, natively supports pre-commit -- repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 - hooks: - - id: black - exclude: ^(docs) - # Check linting and style issues - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.0" + rev: "v0.1.3" hooks: - id: ruff args: ["--fix", "--show-fixes"] + - id: ruff-format + exclude: ^(docs) # Changes tabs to spaces - repo: https://github.com/Lucas-C/pre-commit-hooks diff --git a/pyproject.toml b/pyproject.toml index b0eb9a6..f3032cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,15 +50,16 @@ build-verbosity = 1 [tool.ruff] -select = [ - "E", "F", "W", # flake8 +src = ["src"] + +[tool.ruff.lint] +extend-select = [ "B", # flake8-bugbear "I", # isort "ARG", # flake8-unused-arguments "C4", # flake8-comprehensions "EM", # flake8-errmsg "ICN", # flake8-import-conventions - "ISC", # flake8-implicit-str-concat "G", # flake8-logging-format "PGH", # pygrep-hooks "PIE", # flake8-pie @@ -75,16 +76,9 @@ select = [ "NPY", # NumPy specific rules "PD", # pandas-vet ] -extend-ignore = [ +ignore = [ "PLR", # Design related pylint codes - "E501", # Line too long -] -src = ["src"] -unfixable = [ - "T20", # Removes print statements - "F841", # Removes unused variables ] -flake8-unused-arguments.ignore-variadic-names = true isort.required-imports = ["from __future__ import annotations"] [tool.ruff.per-file-ignores]