Skip to content

Commit

Permalink
Avoid reporting runtime errors with unknown file types
Browse files Browse the repository at this point in the history
When loading inline skip-lists we should just ignore files that
we do not know how to process. This fixes bug where encountering
reno release notes may have cause failure to process noqa on them.
  • Loading branch information
ssbarnea committed Feb 17, 2021
1 parent 0b0b8b5 commit dd656f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ansiblelint/skip_utils.py
Expand Up @@ -108,10 +108,11 @@ def _append_skipped_rules(pyyaml_data: Sequence[Any], lintable: Lintable) -> Seq
# assume it is a playbook, check needs to be added higher in the
# call stack, and can remove this except
return pyyaml_data
elif lintable.kind in ['yaml', 'requirements', 'vars']:
elif lintable.kind in ['yaml', 'requirements', 'vars', 'meta', 'reno']:
return pyyaml_data
else:
raise RuntimeError('Unexpected file type: {}'.format(lintable.kind))
# For unsupported file types, we return empty skip lists
return []

# get tasks from blocks of tasks
pyyaml_tasks = _get_tasks_from_blocks(pyyaml_task_blocks)
Expand Down

0 comments on commit dd656f3

Please sign in to comment.