From fd495494d6b373a46a6be09daa3e9dfef9340f55 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:16:04 -0400 Subject: [PATCH] chore: update pre-commit hooks (#112) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update pre-commit hooks updates: - [github.com/psf/black-pre-commit-mirror: 23.9.1 → 23.10.1](https://github.com/psf/black-pre-commit-mirror/compare/23.9.1...23.10.1) - [github.com/astral-sh/ruff-pre-commit: v0.1.0 → v0.1.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.0...v0.1.3) * chore: move to ruff-format Signed-off-by: Henry Schreiner --------- Signed-off-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner --- .pre-commit-config.yaml | 11 +++-------- pyproject.toml | 16 +++++----------- 2 files changed, 8 insertions(+), 19 deletions(-) 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]