Skip to content

Commit 7d95b38

Browse files
fix: make constants
1 parent a39f9c6 commit 7d95b38

1 file changed

Lines changed: 37 additions & 41 deletions

File tree

codecov_cli/helpers/versioning_systems.py

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,41 @@
1111

1212
logger = logging.getLogger("codecovcli")
1313

14+
IGNORE_DIRS = [
15+
'*.egg-info',
16+
'.DS_Store',
17+
'.circleci',
18+
'.env',
19+
'.envs',
20+
'.git',
21+
'.gitignore',
22+
'.mypy_cache',
23+
'.nvmrc',
24+
'.nyc_output',
25+
'.ruff_cache',
26+
'.venv',
27+
'.venvns',
28+
'.virtualenv',
29+
'.virtualenvs',
30+
'__pycache__',
31+
'bower_components',
32+
'build/lib/',
33+
'jspm_packages',
34+
'node_modules',
35+
'vendor',
36+
'virtualenv',
37+
'virtualenvs',
38+
]
39+
40+
IGNORE_PATHS = [
41+
'*.gif',
42+
'*.jpeg',
43+
'*.jpg',
44+
'*.md',
45+
'*.png',
46+
'shunit2*',
47+
]
48+
1449

1550
class VersioningSystemInterface(ABC):
1651
def __repr__(self) -> str:
@@ -149,45 +184,6 @@ def list_relevant_files(
149184

150185

151186
class NoVersioningSystem(VersioningSystemInterface):
152-
@classmethod
153-
def blockdirs(cls):
154-
return [
155-
'*.egg-info',
156-
'.DS_Store',
157-
'.circleci',
158-
'.env',
159-
'.envs',
160-
'.git',
161-
'.gitignore',
162-
'.mypy_cache',
163-
'.nvmrc',
164-
'.nyc_output',
165-
'.ruff_cache',
166-
'.venv',
167-
'.venvns',
168-
'.virtualenv',
169-
'.virtualenvs',
170-
'__pycache__',
171-
'bower_components',
172-
'build/lib/',
173-
'jspm_packages',
174-
'node_modules',
175-
'vendor',
176-
'virtualenv',
177-
'virtualenvs',
178-
]
179-
180-
@classmethod
181-
def blockfiles(cls):
182-
return [
183-
'*.gif',
184-
'*.jpeg',
185-
'*.jpg',
186-
'*.md',
187-
'*.png',
188-
'shunit2*',
189-
]
190-
191187
@classmethod
192188
def is_available(cls):
193189
return True
@@ -208,8 +204,8 @@ def list_relevant_files(
208204
cmd = [
209205
"find",
210206
dir_to_use,
211-
*chain.from_iterable(["-name", block, "-prune", "-o"] for block in self.__class__.blockdirs()),
212-
*chain.from_iterable(["-path", block, "-prune", "-o"] for block in self.__class__.blockfiles()),
207+
*chain.from_iterable(["-name", block, "-prune", "-o"] for block in IGNORE_DIRS),
208+
*chain.from_iterable(["-path", block, "-prune", "-o"] for block in IGNORE_PATHS),
213209
"-type",
214210
"f",
215211
"-print",

0 commit comments

Comments
 (0)