From fe4a503d62e5fdf6d95c84747a758059cda24072 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Tue, 2 May 2023 12:06:10 +0100 Subject: [PATCH] Use ruff for more checks --- .pre-commit-config.yaml | 29 ++++++++++------------------- pyproject.toml | 6 ++++++ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b307f0d0..7b913052 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,39 +5,30 @@ repos: - id: check-docstring-first - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/asottile/setup-cfg-fmt rev: v2.2.0 hooks: - id: setup-cfg-fmt - - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 - hooks: - - id: flake8 - additional_dependencies: [flake8-typing-imports>=1.9.0] - - repo: https://github.com/PyCQA/autoflake - rev: v2.1.1 - hooks: - - id: autoflake - args: ["--in-place", "--remove-all-unused-imports"] - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort + - repo: https://github.com/psf/black rev: 23.3.0 hooks: - id: black - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.2 - hooks: - - id: pyupgrade - args: [--py38-plus, --keep-runtime-typing] + - repo: https://github.com/tlambert03/napari-plugin-checks rev: v0.3.0 hooks: - id: napari-plugin-checks + - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.2.0 hooks: - id: mypy args: ["--disallow-incomplete-defs", "--ignore-missing-imports"] + + - repo: https://github.com/charliermarsh/ruff-pre-commit + # Ruff version. + rev: 'v0.0.264' + hooks: + - id: ruff diff --git a/pyproject.toml b/pyproject.toml index b1a57c9b..73644cc3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,3 +12,9 @@ line-length = 79 [tool.isort] profile = "black" line_length = 79 + +[tool.ruff] + +target-version = "py38" +select = ["I", "UP", "F", "E", "W"] +fix = true