From c66c57fa75d24be3ff076180444a4d14fd28ee9b Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Sun, 29 Oct 2023 20:16:40 +0000 Subject: [PATCH] maint: add ruff --- .pre-commit-config.yaml | 19 +++++-------------- pyproject.toml | 6 +++--- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43c2da4..cd83312 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,21 +18,12 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/pycqa/isort - rev: 5.12.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.4 hooks: - - id: isort - - - repo: https://github.com/psf/black - rev: 23.10.0 - hooks: - - id: black - - - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 - hooks: - - id: flake8 - additional_dependencies: [flake8-bugbear~=22.7] + - id: ruff + args: ["--fix", "--show-fixes"] + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.6.1 diff --git a/pyproject.toml b/pyproject.toml index b7ba5f1..7655574 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,6 @@ strict_equality = true module = ["docutils.*", "yaml.*"] ignore_missing_imports = true -[tool.isort] -profile = "black" -src_paths = ["sphinx_external_toc", "tests"] + +[tool.ruff.lint.isort] +force-sort-within-sections = true