Skip to content

Commit f3ead51

Browse files
committed
Fix code excludes
1 parent fe51088 commit f3ead51

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

plain-code/plain/code/annotations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def find_python_files(
232232
"*.egg-info",
233233
".mypy_cache",
234234
".pytest_cache",
235+
"node_modules",
235236
# Exclude test files from annotation metrics
236237
"test_*.py",
237238
"*_test.py",

plain-code/plain/code/biome_defaults.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"includes": [
1010
"**",
1111
"!**/vendor/**",
12+
"!**/node_modules/**",
1213
"!**/*.min.*",
1314
"!**/tests/**",
1415
"!**/htmlcov/**",

plain-code/plain/code/cli.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ def maybe_exit(return_code: int) -> None:
116116

117117
if not skip_ty and config.get("ty", {}).get("enabled", True):
118118
print_event("ty check...", newline=False)
119-
result = subprocess.run(["ty", "check", path, "--no-progress"])
119+
ty_args = ["ty", "check", path, "--no-progress"]
120+
for e in config.get("exclude", []):
121+
ty_args.extend(["--exclude", e])
122+
result = subprocess.run(ty_args)
120123
maybe_exit(result.returncode)
121124

122125
if not skip_biome and config.get("biome", {}).get("enabled", True):
@@ -131,7 +134,9 @@ def maybe_exit(return_code: int) -> None:
131134

132135
if not skip_annotations and config.get("annotations", {}).get("enabled", True):
133136
print_event("annotations...", newline=False)
134-
exclude_patterns = config.get("annotations", {}).get("exclude", [])
137+
# Combine top-level exclude with annotation-specific exclude
138+
exclude_patterns = list(config.get("exclude", []))
139+
exclude_patterns.extend(config.get("annotations", {}).get("exclude", []))
135140
ann_result = check_annotations(path, exclude_patterns or None)
136141
if ann_result.missing_count > 0:
137142
click.secho(
@@ -152,7 +157,9 @@ def maybe_exit(return_code: int) -> None:
152157
def annotations(path: str, details: bool, as_json: bool) -> None:
153158
"""Check type annotation status"""
154159
config = get_code_config()
155-
exclude_patterns = config.get("annotations", {}).get("exclude", [])
160+
# Combine top-level exclude with annotation-specific exclude
161+
exclude_patterns = list(config.get("exclude", []))
162+
exclude_patterns.extend(config.get("annotations", {}).get("exclude", []))
156163
result = check_annotations(path, exclude_patterns or None)
157164
if as_json:
158165
_print_annotations_json(result)

0 commit comments

Comments
 (0)