pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/7b2764e798e400b8f5fcc199739405e6fbd05c20

48faa60c69660fa.css" /> gh-110558: Run ruff on Argument Clinic in CI (#110559) · python/cpython@7b2764e · GitHub
Skip to content

Commit 7b2764e

Browse files
authored
gh-110558: Run ruff on Argument Clinic in CI (#110559)
1 parent 96fed66 commit 7b2764e

5 files changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77

88
env:
99
FORCE_COLOR: 1
10-
RUFF_FORMAT: github
10+
RUFF_OUTPUT_FORMAT: github
1111

1212
concurrency:
1313
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ repos:
66
name: Run Ruff on Lib/test/
77
args: [--exit-non-zero-on-fix]
88
files: ^Lib/test/
9+
- id: ruff
10+
name: Run Ruff on Tools/clinic/
11+
args: [--exit-non-zero-on-fix, --config=Tools/clinic/.ruff.toml]
12+
files: ^Tools/clinic/|Lib/test/test_clinic.py
913

1014
- repo: https://github.com/pre-commit/pre-commit-hooks
1115
rev: v4.4.0

Lib/test/.ruff.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ select = [
33
"F811", # Redefinition of unused variable (useful for finding test methods with the same name)
44
]
55
extend-exclude = [
6+
# Excluded (run with the other AC files in its own separate ruff job in pre-commit)
7+
"test_clinic.py",
68
# Excluded (these aren't actually executed, they're just "data files")
79
"tokenizedata/*.py",
810
# Failed to lint

Tools/clinic/.ruff.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
target-version = "py310"
2+
fix = true
3+
select = [
4+
"F", # Enable all pyflakes rules
5+
"RUF100", # Ban unused `# noqa` comments
6+
"PGH004", # Ban blanket `# noqa` comments (only ignore specific error codes)
7+
]
8+
unfixable = [
9+
# The autofixes sometimes do the wrong things for these;
10+
# it's better to have to manually look at the code and see how it needs fixing
11+
"F841", # Detects unused variables
12+
"F601", # Detects dictionaries that have duplicate keys
13+
"F602", # Also detects dictionaries that have duplicate keys
14+
]

Tools/clinic/clinic.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,6 @@ def compiler_deprecated_warning(
924924

925925
# Format the preprocessor warning and error messages.
926926
assert isinstance(self.cpp.filename, str)
927-
source = os.path.basename(self.cpp.filename)
928927
message = f"Update the clinic input of {func.full_name!r}."
929928
code = self.COMPILER_DEPRECATION_WARNING_PROTOTYPE.format(
930929
major=minversion[0],
@@ -1846,7 +1845,6 @@ def render_function(
18461845
last_group = 0
18471846
first_optional = len(selfless)
18481847
positional = selfless and selfless[-1].is_positional_only()
1849-
new_or_init = f.kind.new_or_init
18501848
has_option_groups = False
18511849

18521850
# offset i by -1 because first_optional needs to ignore self
@@ -6343,7 +6341,6 @@ def check_remaining_star(self, lineno: int | None = None) -> None:
63436341
else:
63446342
return
63456343

6346-
no_param_after_symbol = True
63476344
for p in reversed(self.function.parameters.values()):
63486345
if self.keyword_only:
63496346
if p.kind == inspect.Parameter.KEYWORD_ONLY:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy