fixes linter for directories with json files

Fixes error when linting the `json-modules` feature which points to test/language/import/import-attributes, containing .json fixture files.

The linter's file_is_test() function was only filtering out FIXTURE.js files but not .json files, so it tried to read frontmatter from the JSON files and failed.
This commit is contained in:
Chris Cuellar 2025-10-05 13:06:30 -07:00
parent d151c921fc
commit edfec3e641

View File

@ -22,7 +22,7 @@ def read_features(filename):
return yaml.safe_load(frontmatter).get('features', []) return yaml.safe_load(frontmatter).get('features', [])
def file_is_test(filename): def file_is_test(filename):
return not filename.endswith('FIXTURE.js') return not (filename.endswith('FIXTURE.js') or filename.endswith('.json'))
def pattern_from_path_spec(path_spec): def pattern_from_path_spec(path_spec):
return re.compile(re.sub('\*', '.*', path_spec)) return re.compile(re.sub('\*', '.*', path_spec))