Skip to content

gh-60283: Check for redefined test names in CI #109161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Sep 12, 2023
Merged
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.287
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
files: ^Lib/test/

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand Down
38 changes: 38 additions & 0 deletions Lib/test/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
fix = true
select = [
"F811", # Redefinition of unused variable (useful for finding test methods with the same name)
]
extend-exclude = [
# Failed to lint
"badsyntax_pep3120.py",
"encoded_modules/module_iso_8859_1.py",
"encoded_modules/module_koi8_r.py",
# Failed to parse
"mod_generics_cache.py",
"badsyntax_3131.py",
"support/socket_helper.py",
"test_builtin.py",
"test_fstring.py",
"test_funcattrs.py",
"test_functools.py",
"test_type_aliases.py",
"test_type_params.py",
"test_typing.py",
# TODO Fix: F811 Redefinition of unused name
"test__opcode.py",
"test_buffer.py",
"test_ctypes/test_arrays.py",
"test_ctypes/test_functions.py",
"test_dataclasses/__init__.py",
"test_descr.py",
"test_enum.py",
"test_genericclass.py",
"test_grammar.py",
"test_import/__init__.py",
"test_keywordonlyarg.py",
"test_pkg.py",
"test_subclassinit.py",
"test_unittest/testmock/testpatch.py",
"test_yield_from.py",
"time_hashlib.py",
]