File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ Customize how Ansible-lint runs against automation content to suit your needs.
44You can ignore certain rules, enable ` opt-in ` rules, and control various other
55settings.
66
7- Ansible-lint loads configuration from a file in the current working directory or
8- from a file that you specify in the command line.
7+ Ansible-lint loads configuration from a file in the project root directory (current
8+ working directory) or from a file that you specify in the command line. Executing the
9+ linter from the project root is required for correct file discovery and dependency resolution.
910
1011Any configuration option that is passed from the command line will override
1112the one specified inside the configuration file.
@@ -19,8 +20,11 @@ in your current working directory.
1920
2021!!! note
2122
22- If Ansible-lint cannot find a configuration file in the current directory it attempts to locate it in a parent directory.
23- However Ansible-lint does not try to load configuration that is outside the git repository.
23+ If Ansible-lint cannot find a configuration file in the current directory it
24+ attempts to locate it in a parent directory. However, Ansible-lint does not
25+ try to load configuration that is outside the git repository. **Note that
26+ while the config may be found in a parent directory, the linter still
27+ expects to be executed from the root of the project being linted.**
2428
2529## Specifying configuration files
2630
Original file line number Diff line number Diff line change @@ -55,6 +55,13 @@ where it failed to work as expected and caused false negatives.
5555
5656## Linting playbooks and roles
5757
58+ !!! warning "Execution Directory"
59+
60+ **Always run `ansible-lint` from the root of your project or collection.**
61+ As of version 25.7.0, running the linter from within a subdirectory
62+ (such as inside a `roles/` or `tasks/` folder) is not supported and
63+ may result in zero errors being reported even if violations exist.
64+
5865Ansible-lint recommends following the [ collection structure layout] whether you
5966plan to build a collection or not.
6067
Original file line number Diff line number Diff line change 11{
22 "ansible-lint-config" : {
3- "etag" : " d08ce380364a2935299f89bf453787601d44a1bc6b70a38afaec4a8b0b80d104 " ,
3+ "etag" : " 1fe2e8bc4dd6a77c4055bf063a0983725fde4133c981335413d6503fe2e543ed " ,
44 "url" : " https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json"
55 },
66 "ansible-navigator-config" : {
2424 "url" : " https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/inventory.json"
2525 },
2626 "meta" : {
27- "etag" : " d63b91b4cb6a73cde4d9d98b7b5d9bbaf8ed568173e90682afb5b11cd6ba55b3 " ,
27+ "etag" : " d2f353a0077365ff075b14876b619ef65e7268129fd12b4f1b571549f2f39f14 " ,
2828 "url" : " https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/meta.json"
2929 },
3030 "meta-runtime" : {
You can’t perform that action at this time.
0 commit comments