Skip to content

Commit d950bb1

Browse files
style: auto-fix formatting and resolve mypy no-redef error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 35091cd commit d950bb1

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

codeflash/discovery/functions_to_optimize.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ def generic_visit(self, node: ast.AST) -> None:
149149
_VCS_EXCLUDES = frozenset({".git", ".hg", ".svn"})
150150

151151

152-
def parse_dir_excludes(
153-
patterns: frozenset[str],
154-
) -> tuple[frozenset[str], tuple[str, ...], tuple[str, ...]]:
152+
def parse_dir_excludes(patterns: frozenset[str]) -> tuple[frozenset[str], tuple[str, ...], tuple[str, ...]]:
155153
"""Split glob patterns into exact names, prefixes, and suffixes.
156154
157155
Patterns ending with ``*`` become prefix matches, patterns starting with ``*``
@@ -187,13 +185,14 @@ def get_files_for_language(
187185
if ignore_paths is None:
188186
ignore_paths = []
189187

188+
all_patterns: frozenset[str]
190189
if language is not None:
191190
support = get_language_support(language)
192191
extensions = support.file_extensions
193192
all_patterns = support.dir_excludes | _VCS_EXCLUDES
194193
else:
195194
extensions = tuple(get_supported_extensions())
196-
all_patterns: frozenset[str] = _VCS_EXCLUDES
195+
all_patterns = _VCS_EXCLUDES
197196
for lang in Language:
198197
if is_language_supported(lang):
199198
all_patterns = all_patterns | get_language_support(lang).dir_excludes

codeflash/languages/python/support.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,34 @@ def comment_prefix(self) -> str:
7777

7878
@property
7979
def dir_excludes(self) -> frozenset[str]:
80-
return frozenset({
81-
"__pycache__", ".venv", "venv", ".tox", ".nox", ".eggs",
82-
".mypy_cache", ".ruff_cache", ".pytest_cache", ".hypothesis",
83-
"htmlcov", ".pytype", ".pyre", ".pybuilder",
84-
".ipynb_checkpoints", ".codeflash", ".cache", ".complexipy_cache",
85-
"build", "dist", "sdist",
86-
".coverage*", ".pyright*", "*.egg-info",
87-
})
80+
return frozenset(
81+
{
82+
"__pycache__",
83+
".venv",
84+
"venv",
85+
".tox",
86+
".nox",
87+
".eggs",
88+
".mypy_cache",
89+
".ruff_cache",
90+
".pytest_cache",
91+
".hypothesis",
92+
"htmlcov",
93+
".pytype",
94+
".pyre",
95+
".pybuilder",
96+
".ipynb_checkpoints",
97+
".codeflash",
98+
".cache",
99+
".complexipy_cache",
100+
"build",
101+
"dist",
102+
"sdist",
103+
".coverage*",
104+
".pyright*",
105+
"*.egg-info",
106+
}
107+
)
88108

89109
# === Discovery ===
90110

0 commit comments

Comments
 (0)