Skip to content

Commit

Permalink
Avoid warnings with empty role meta files (#2580)
Browse files Browse the repository at this point in the history
Fixes: #2579
  • Loading branch information
ssbarnea authored Oct 10, 2022
1 parent 19f9e60 commit 1887d39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/meta_incorrect.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MetaChangeFromDefaultRule(AnsibleLintRule):
version_added = "v4.0.0"

def matchyaml(self, file: Lintable) -> list[MatchError]:
if file.kind != "meta":
if file.kind != "meta" or not file.data:
return []

galaxy_info = file.data.get("galaxy_info", None)
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/meta_no_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MetaTagValidRule(AnsibleLintRule):

def matchyaml(self, file: Lintable) -> list[MatchError]:
"""Find violations inside meta files."""
if file.kind != "meta":
if file.kind != "meta" or not file.data:
return []

galaxy_info = file.data.get("galaxy_info", None)
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/meta_video_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MetaVideoLinksRule(AnsibleLintRule):
}

def matchyaml(self, file: Lintable) -> list[MatchError]:
if file.kind != "meta":
if file.kind != "meta" or not file.data:
return []

galaxy_info = file.data.get("galaxy_info", None)
Expand Down

0 comments on commit 1887d39

Please sign in to comment.