Skip to content

Commit 10a32d8

Browse files
committed
Always ignore the tests/.tests directory when linting
ruff will ignore it automatically when this is a git repo but will not when it's a source distribution.
1 parent 88b277b commit 10a32d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/lsst/sconsUtils/tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,14 @@ def runPythonLinter(self):
364364
for path in glob.glob(os.path.join(self._tmpDir, "linter-*.log*")):
365365
os.unlink(path)
366366

367+
# Always exclude the tests output directory. This should never be
368+
# examined.
369+
lint_options = "--extend-exclude=tests/.tests"
370+
367371
cmd = f"""
368372
@printf "%s\\n" 'Running python linter {linter}...';
369373
@rm -f ${{TARGET}} ${{TARGET}}.failed;
370-
@({linter} . > ${{TARGET}}); \
374+
@({linter} {lint_options} . > ${{TARGET}}); \
371375
export rc="$?"; \
372376
if [ "$$rc" -eq 0 ]; then \
373377
echo "Python linting completed successfully"; \

0 commit comments

Comments
 (0)