From 9e8cc1f92d84fed6eb9602371709b6a88e47f688 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Tue, 7 Nov 2023 20:21:29 +0000 Subject: [PATCH] maint: add ruff (#101) --- .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