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

Make the code ansible-lint happy #48

Open
rgl opened this issue Sep 18, 2022 · 0 comments
Open

Make the code ansible-lint happy #48

rgl opened this issue Sep 18, 2022 · 0 comments

Comments

@rgl
Copy link

rgl commented Sep 18, 2022

Can this be ansible-lint happy?

For example, with ansible-lint 6.5.2 (and ansible-core 2.13.4), this is the result:

$ ./ansible-lint.sh --offline --parseable home.yml
WARNING  Listing 31 violation(s) that are fatal
../usr/share/ansible/roles/gekmihesg.openwrt/defaults/main.yml:2: yaml: truthy value should be one of  (yaml[truthy])
../usr/share/ansible/roles/gekmihesg.openwrt/defaults/main.yml:4: yaml: truthy value should be one of  (yaml[truthy])
../usr/share/ansible/roles/gekmihesg.openwrt/defaults/main.yml:12: yaml: truthy value should be one of  (yaml[truthy])
../usr/share/ansible/roles/gekmihesg.openwrt/defaults/main.yml:14: yaml: truthy value should be one of  (yaml[truthy])
../usr/share/ansible/roles/gekmihesg.openwrt/handlers/main.yml:2: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/handlers/main.yml:8: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/handlers/main.yml:14: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/handlers/main.yml:20: fqcn-builtins: Use FQCN for builtin actions.
../usr/share/ansible/roles/gekmihesg.openwrt/handlers/main.yml:20: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/meta/main.yml:1: role-name: Role name gekmihesg.openwrt does not match ``^*$`` pattern.
../usr/share/ansible/roles/gekmihesg.openwrt/meta/main.yml:1: schema: 2.4 is not of type 'string' (schema[meta])
../usr/share/ansible/roles/gekmihesg.openwrt/meta/main.yml:9: yaml: missing starting space in comment (yaml[comments])
../usr/share/ansible/roles/gekmihesg.openwrt/meta/main.yml:10: yaml: missing starting space in comment (yaml[comments])
../usr/share/ansible/roles/gekmihesg.openwrt/meta/main.yml:13: yaml: missing starting space in comment (yaml[comments])
../usr/share/ansible/roles/gekmihesg.openwrt/meta/main.yml:17: yaml: wrong indentation: expected 4 but found 2 (yaml[indentation])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/main.yml:2: fqcn-builtins: Use FQCN for builtin actions.
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/main.yml:2: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/package.yml:2: fqcn-builtins: Use FQCN for builtin actions.
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/package.yml:2: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/package.yml:9: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:2: fqcn-builtins: Use FQCN for builtin actions.
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:2: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:7: fqcn-builtins: Use FQCN for builtin actions.
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:7: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:14: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:17: yaml: truthy value should be one of  (yaml[truthy])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:24: fqcn-builtins: Use FQCN for builtin actions.
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:24: name: All names should start with an uppercase letter. (name[casing])
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:38: fqcn-builtins: Use FQCN for builtin actions.
../usr/share/ansible/roles/gekmihesg.openwrt/tasks/packages.yml:38: name: All names should start with an uppercase letter. (name[casing])
home.yml:7: fqcn-builtins: Use FQCN for builtin actions.
You can skip specific rules or tags by adding them to your configuration file:
# .config/ansible-lint.yml
warn_list:  # or 'skip_list' to silence them completely
  - experimental  # all rules tagged as experimental
  - fqcn-builtins  # Use FQCN for builtin actions.
  - yaml[comments]  # Violations reported by yamllint.
  - yaml[indentation]  # Violations reported by yamllint.
  - yaml[truthy]  # Violations reported by yamllint.

Finished with 17 failure(s), 14 warning(s) on 7 files.

Would a PR to fix this be acceptable?

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

No branches or pull requests

1 participant