mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1369710 - [mozlint] Ensure that a valid path is entered. r=ahal
MozReview-Commit-ID: 6HOE9hmOkCx --HG-- extra : rebase_source : 584a4391b832e794dc084254e9203b3a65c89419
This commit is contained in:
parent
3bd6c5f20a
commit
db4f4de93a
@ -113,6 +113,12 @@ def run(paths, linters, fmt, outgoing, workdir, **lintargs):
|
||||
lint = LintRoller(**lintargs)
|
||||
lint.read(find_linters(linters))
|
||||
|
||||
# Check if the path that is entered is a valid one.
|
||||
invalid_paths = [path for path in paths if not os.path.exists(path)]
|
||||
if invalid_paths:
|
||||
print("Error: The following paths do not exist:\n{}".format("\n".join(invalid_paths)))
|
||||
return 1
|
||||
|
||||
# run all linters
|
||||
results = lint.roll(paths, outgoing=outgoing, workdir=workdir)
|
||||
formatter = formatters.get(fmt)
|
||||
|
Loading…
Reference in New Issue
Block a user