From b7709ae6fe158a718765935db224f0d7ff8dd2c7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:54:55 +0000 Subject: [PATCH 1/4] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 33555e5d5c..a130fbbec5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.2.0 hooks: - id: ruff types: [file] From cbb3c266e1a46268a34eb35e25e5775bf71ed9c4 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:20:50 -0600 Subject: [PATCH 2/4] Update to ruff `0.2.1` --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a130fbbec5..257ff9409c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.0 + rev: v0.2.1 hooks: - id: ruff types: [file] From 34f35d3ce759a00068ae95f0738421daea10867c Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:23:32 -0600 Subject: [PATCH 3/4] Move configuration to new areas from depreciated areas --- pyproject.toml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a12432edc6..e4d0360cbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,12 +86,20 @@ ignore-words-list = 'astroid,crasher,asend' respect-gitignore = true fix = true -allowed-confusables = ["–"] - # The directories to consider when resolving first vs. third-party imports. # Does not control what files to include/exclude! src = ["src/trio", "notes-to-self"] +include = ["*.py", "*.pyi", "**/pyproject.toml"] + +extend-exclude = [ + "docs/source/reference-*", + "docs/source/tutorial/*", +] + +[tool.ruff.lint] +allowed-confusables = ["–"] + select = [ "A", # flake8-builtins "ASYNC", # flake8-async @@ -120,14 +128,7 @@ extend-ignore = [ 'SIM117', # multiple-with-statements (messes up lots of context-based stuff and looks bad) ] -include = ["*.py", "*.pyi", "**/pyproject.toml"] - -extend-exclude = [ - "docs/source/reference-*", - "docs/source/tutorial/*", -] - -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # F401 is ignoring unused imports. For these particular files, # these are public APIs where we are importing everything we want # to export for public use. @@ -138,10 +139,10 @@ extend-exclude = [ 'src/trio/socket.py' = ['F401'] 'src/trio/testing/__init__.py' = ['F401'] -[tool.ruff.isort] +[tool.ruff.lint.isort] combine-as-imports = true -[tool.ruff.flake8-pytest-style] +[tool.ruff.lint.flake8-pytest-style] fixture-parentheses = false [tool.mypy] From 2aa5065f8fef04590b71c69b103535ad16444c4e Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:51:07 -0600 Subject: [PATCH 4/4] Not required but update test version to ruff 0.2.1 --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 5ae8154556..f1d10a032c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -120,7 +120,7 @@ pytz==2024.1 # via babel requests==2.31.0 # via sphinx -ruff==0.2.0 +ruff==0.2.1 # via -r test-requirements.in sniffio==1.3.0 # via -r test-requirements.in