Skip to content

Commit

Permalink
Avoid reporting main role task files as unknown (#1087)
Browse files Browse the repository at this point in the history
Currently main.y[a]ml files are reported initially as unknown files
while the role is detected correctly. Later they are linted but we
should avoid printing confusing messages.
  • Loading branch information
ssbarnea committed Nov 2, 2020
1 parent a4e6409 commit 5e1ac9c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/ansiblelint/utils.py
Expand Up @@ -764,6 +764,7 @@ def get_playbooks_and_roles(options=None) -> List[str]: # noqa: C901
elif 'roles' in p.parts or '.' in role_dirs:
if 'tasks' in p.parts and p.parts[-1] in ['main.yaml', 'main.yml']:
role_dirs.append(str(p.parents[1]))
continue
elif role_internals.intersection(p.parts):
continue
elif 'tests' in p.parts:
Expand Down

0 comments on commit 5e1ac9c

Please sign in to comment.