From 7e5460e18f61052ad058633e9b2b01b252e79b9a Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 17 Apr 2025 18:21:08 -0700 Subject: [PATCH] MNT: replace flake8 + isort with ruff --- .pre-commit-config.yaml | 17 ++++++++--------- ruff.toml | 9 +++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 ruff.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e8582abb..ffdb820b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: no-commit-to-branch - id: trailing-whitespace @@ -23,12 +23,11 @@ repos: - id: shellcheck args: [-x] # allow source files outside of checked files -- repo: https://github.com/pycqa/flake8.git - rev: 6.0.0 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.6 hooks: - - id: flake8 - -- repo: https://github.com/timothycrosley/isort - rev: 5.11.5 - hooks: - - id: isort + # Run the linter. + - id: ruff + args: [ --fix ] + # Run the formatter. + - id: ruff-format diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000..025ef914 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,9 @@ +exclude = [ + ".git", +] + +line-length = 88 + +[lint] +select = ["C", "E", "F", "W", "B", "I"] +ignore = ["C901"]