Skip to content

Commit 1f1c806

Browse files
authored
Merge pull request #116 from lsst/tickets/DM-40033
DM-40033: Exclude tests/.tests when running linters
2 parents 88b277b + 3be1503 commit 1f1c806

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

python/lsst/sconsUtils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Try to import the generated version module.
1717
try:
1818
from .version import *
19-
except:
19+
except Exception:
2020
__version__ = "unknown"
2121

2222
# These should remain in their own namespaces

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)