Bug 1373368 - [mozlint] Raise if a non-existant path is specified in a lint config, r=standard8

Since I left the next two patches to bitrot, I realized that a path I had added
didn't exist anymore. We should definitely error out if non-existant paths are
specified, otherwise the lists will become outdated and it will be possible to
accidentally disable linting on some files.

I discovered a few instances of this already in our existing definitions.

MozReview-Commit-ID: 8jsTKLI0nFE
This commit is contained in:
Andrew Halberstadt
2018-03-29 14:50:17 -04:00
parent 3f55f4e5c1
commit f297ed8c8f
13 changed files with 67 additions and 23 deletions

View File

@@ -15,10 +15,12 @@ from mozlint.errors import (
LinterParseError,
)
here = os.path.abspath(os.path.dirname(__file__))
@pytest.fixture(scope='module')
def parse(lintdir):
parser = Parser()
parser = Parser(here)
def _parse(name):
path = os.path.join(lintdir, name)
@@ -48,6 +50,9 @@ def test_parse_valid_linter(parse):
'invalid_exclude.yml',
'missing_attrs.yml',
'missing_definition.yml',
'non_existing_include.yml',
'non_existing_exclude.yml',
'non_existing_support_files.yml',
])
def test_parse_invalid_linter(parse, linter):
with pytest.raises(LinterParseError):