Skip to content

Commit 282b018

Browse files
committed
Ignore pycache in aliases checks
1 parent 5b2d79e commit 282b018

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/aliases.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def imports_add(file):
5959
pkg = str(file.parent.relative_to(root)).replace("/", ".")
6060
if file.name == "__init__.py":
6161
imports.append(pkg)
62-
elif file.name.endswith(".py"):
62+
elif file.suffix == ".py":
6363
imports.append(pkg + "." + file.name[:-3])
6464

6565
for source in SOURCES:
@@ -147,6 +147,8 @@ def check_file(path):
147147
global ok
148148
if path.parent == root or any(path.is_relative_to(p) for p in ignored):
149149
return
150+
if path.suffix == ".pyc" or "__pycache__" in path.parts:
151+
return
150152
if path not in managed:
151153
print(f"Error: {path} shouldn't exist.")
152154
ok = False

0 commit comments

Comments
 (0)