-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/ansiblelint/file_utils.py: Fix playbook/rulebook detection
Don't try detecting the file type unless file already loaded in Lintable._data, otherwise the line numbers for inline rule skipping will be set to the line where's it's used since self.kind is 'yaml'. After _guess_kind() call, the kind will be set to playbook and the error line will be the one of the task, which is possibly different that the one with the 'noqa:' comment. Fixes: #2977 Signed-off-by: Arnaud Patard <apatard@hupstream.com>
- Loading branch information
Showing
3 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters