From 26036fdb254543c28cbfc20f6d38bf190c23d6e5 Mon Sep 17 00:00:00 2001 From: Tyson Smith Date: Mon, 16 Sep 2024 10:08:16 -0700 Subject: [PATCH] [ci] Replace isort and pyupgrade with ruff --- .pre-commit-config.yaml | 15 +++------------ pyproject.toml | 16 ++++++++++------ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 352fb47..df8e2fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,21 +1,12 @@ repos: - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.5 hooks: - - id: pyupgrade - args: ["--py38-plus"] + - id: ruff - repo: https://github.com/ambv/black rev: 24.8.0 hooks: - id: black - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.3 - hooks: - - id: ruff - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 5bfe956..ad7e7fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,10 +22,6 @@ exclude_lines = [ "pragma: no cover", ] -[tool.isort] -known_first_party = "ffpuppet" -profile = "black" - [tool.mypy] ignore_missing_imports = true strict = true @@ -55,6 +51,10 @@ ignored-modules = ["pytest"] [tool.pytest.ini_options] log_level = "DEBUG" +[tool.ruff] +fix = true +target-version = "py38" + [tool.ruff.lint] select = [ # flake8-comprehensions @@ -65,14 +65,18 @@ select = [ "F", # Flynt "FLY", + # isort + "I", # Perflint "PERF", + # Ruff-specific rules + "RUF", # flake8-simplify "SIM", # flake8-type-checking "TCH", - # Ruff-specific rules - "RUF", + # pyupgrade + "UP", # pycodestyle "W", ]