Skip to content

Commit 3d1998c

Browse files
committed
Update rules refused in main and fixed upstream
1 parent 116ab59 commit 3d1998c

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

lib/ts_utils/paths.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def distribution_path(distribution_name: str) -> Path:
2424
def tests_path(distribution_name: str) -> Path:
2525
if distribution_name == "stdlib":
2626
return STDLIB_PATH / TESTS_DIR
27-
return STUBS_PATH / distribution_name / TESTS_DIR
27+
else:
28+
return STUBS_PATH / distribution_name / TESTS_DIR
2829

2930

3031
def test_cases_path(distribution_name: str) -> Path:

pyproject.toml

+5-12
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,12 @@ select = [
5353
"FA", # flake8-future-annotations
5454
"FBT", # flake8-boolean-trap
5555
"FLY", # flynt
56-
"G", # flake8-logging-format
5756
"I", # isort
5857
"ISC", # flake8-implicit-str-concat
59-
"LOG", # flake8-logging
6058
"N", # pep8-naming
61-
"NPY", # NumPy-specific rules
62-
"PERF", # Perflint
6359
"PGH", # pygrep-hooks
6460
"PIE", # flake8-pie
6561
"PL", # Pylint
66-
"RET", # flake8-return
6762
"RSE", # flake8-raise
6863
"RUF", # Ruff-specific and unused-noqa
6964
"S", # flake8-bandit
@@ -200,17 +195,15 @@ ignore = [
200195
"A002", # builtin-argument-shadowing
201196
"A004", # builtin-import-shadowing
202197
"F403", # `from . import *` used; unable to detect undefined names
198+
"PIE796", # Enum contains duplicate value
199+
"PLC2701", # Private name import from external module # https://github.com/astral-sh/ruff/issues/15294 and https://github.com/astral-sh/ruff/issues/15295
200+
"S105", # Possible hardcoded password assigned
201+
"S106", # Possible hardcoded password assigned to argument
202+
"S107", # Possible hardcoded password assigned to function default
203203
"S3", # Use of insecure ...
204204
# Most pep8-naming rules don't apply for third-party stubs like typeshed.
205205
# N811 to N814 could apply, but we often use them to disambiguate a name whilst making it look like a more common one
206206
"N8",
207-
"PIE796", # Enum contains duplicate value # astral-sh/ruff#15132
208-
"PLC2701", # Private name import from external module
209-
"PLW1641", # Object does not implement __hash__ method
210-
"S105", # Possible hardcoded password assigned
211-
"S106", # Possible hardcoded password assigned to argument
212-
"S107", # Possible hardcoded password assigned to function default
213-
"S4", # Insecure and vulnerable libraries
214207
# Stubs can sometimes re-export entire modules.
215208
# Issues with using a star-imported name will be caught by type-checkers.
216209
"F405", # may be undefined, or defined from star imports

tests/pytype_test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ def run_all_tests(*, files_to_test: Sequence[str], print_stderr: bool, dry_run:
228228
python_version = f"{sys.version_info.major}.{sys.version_info.minor}"
229229
print("Testing files with pytype...")
230230
for i, f in enumerate(files_to_test):
231-
stderr = None if dry_run else run_pytype(filename=f, python_version=python_version, missing_modules=missing_modules)
231+
if dry_run:
232+
stderr = None
233+
else:
234+
stderr = run_pytype(filename=f, python_version=python_version, missing_modules=missing_modules)
232235
if stderr:
233236
if print_stderr:
234237
print(f"\n{stderr}")

0 commit comments

Comments
 (0)