Skip to content

Commit

Permalink
linter: Prevent testing is_file_ignored() with filepath == None
Browse files Browse the repository at this point in the history
As reported in #548, there
might be a problem with	pathspec 0.11.1 which does't allow calling
`match_file()` with argument `None` anymore.

The `linter.run()` function shouldn't call
`YamlLintConfig.is_file_ignored(None)` anyway.
  • Loading branch information
adrienverge committed Mar 16, 2023
1 parent 4046563 commit e6c890b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yamllint/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def run(input, conf, filepath=None):
:param input: buffer, string or stream to read from
:param conf: yamllint configuration object
"""
if conf.is_file_ignored(filepath):
if filepath is not None and conf.is_file_ignored(filepath):
return ()

if isinstance(input, (bytes, str)):
Expand Down

0 comments on commit e6c890b

Please sign in to comment.