Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix meta-incorrect rule to report correctly #1514

Closed

Conversation

ansiblejunky
Copy link
Contributor

The meta-incorrect rule was not reporting at all when running ansible-lint. I noticed this when creating a separate PR for another rule. It was a simple fix with the create_matcherror() method params.

Output before the fix - rule is not listed:

$ ansible-lint
WARNING  Listing 5 violation(s) that are fatal
:0: meta-incorrect Should change default metadata: author
:0: meta-incorrect Should change default metadata: company
:0: meta-incorrect Should change default metadata: license
my_namespace/my_collection/playbooks/play.yml:16: unnamed-task All tasks should be named
my_namespace/my_collection/roles/myrole/meta/main.yml:0: meta-no-info Role info should contain platforms
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - meta-incorrect  # meta/main.yml default values should be changed
  - meta-no-info  # meta/main.yml should contain relevant info
  - unnamed-task  # All tasks should be named
Finished with 5 failure(s), 0 warning(s) on 10 files.

Output after the fix shows the rule now and with all the nice info:

$ ansible-lint
WARNING  Listing 5 violation(s) that are fatal
my_namespace/my_collection/playbooks/play.yml:16: unnamed-task All tasks should be named
my_namespace/my_collection/roles/myrole/meta/main.yml:0: meta-no-info Role info should contain platforms
my_namespace/my_collection/roles/myrole/meta/main.yml:1: meta-incorrect Should change default metadata: author
my_namespace/my_collection/roles/myrole/meta/main.yml:1: meta-incorrect Should change default metadata: company
my_namespace/my_collection/roles/myrole/meta/main.yml:1: meta-incorrect Should change default metadata: license
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - meta-incorrect  # meta/main.yml default values should be changed
  - meta-no-info  # meta/main.yml should contain relevant info
  - unnamed-task  # All tasks should be named
Finished with 5 failure(s), 0 warning(s) on 10 files.

@ssbarnea ssbarnea added the bug label Apr 7, 2021
@ssbarnea
Copy link
Member

ssbarnea commented Apr 7, 2021

Fixed via #1515 as fixing broken linters in github UI is not really possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants