-
Notifications
You must be signed in to change notification settings - Fork 656
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
It lints excluded paths in 6.16.2 #3477
Comments
Same behavior here; reverting to 6.16.1 restores the proper behavior. |
Same here on |
Same behavior here; reverting to 6.16.1 restores the proper behavior. |
I can confirm the same behaviour |
I wonder if https://github.com/ansible/ansible-lint/pull/3468/files is related. That was an obvious change in 6.16.2 PS - You can just thumbsup the original post if you are affected. You don't have to say 'me too'. |
Can one of you mention how you are calling ansible-lint? I have the impression that you might be calling it from an incorrect pre-commit config, that is because by default pre-commit might attempt to pass each file as an argument to the tool, and in this case the excludes will not longer work. Please help us reproduce it, and so we can make a hotfix. The only case where excludes will be ignored is if you pass the file as an argument. For example Still, without arguments or with something like |
I am not using it in pre-commit, but similar to the first post:
This works if I use v6.16.1 but stopped working since the release of v6.16.2 |
I exclude it via exclude_paths:
- .cache/ # implicit unless exclude_paths is defined in config
- .git/
- roles/monitoring/files/alerts.d/ exec: user@instance:~/ansible$ ansible-lint
WARNING Listing 30 violation(s) that are fatal
yaml[trailing-spaces]: Trailing spaces
roles/monitoring/files/alerts.d/dl.yml:5
yaml[line-length]: Line too long (178 > 160 characters)
roles/monitoring/files/alerts.d/dl.yml:6 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The folder paths in my
|
If one of you can confirm if #3487 is fixing the issue it would be great. I will wait for at least one confirmation before getting the fix in and making a new release. |
Unfortunately I still get the same error with the fix, see below. Version:
.ansible-lint has no trailing /:
Run:
Edit: Ok, I admit that there's a / after the node_modules 😄 but I just tested with removing that and still the same result. Also none of the errors were in the node_modules anyway. |
I'm also still having the same issue with #3487. See below (there is no $ ansible-lint --version
ansible-lint 6.16.3.dev9 using ansible-core:2.15.0 ruamel-yaml:0.17.26 ruamel-yaml-clib:0.2.7
You are using a pre-release version of ansible-lint.
$ ansible-lint --exclude roles/tailscale
WARNING Listing 1 violation(s) that are fatal
fqcn[action-core]: Use FQCN for builtin module actions (lineinfile).
roles/tailscale/tasks/main.yml:16 Use `ansible.builtin.lineinfile` or `ansible.legacy.lineinfile` instead.
Read documentation for instructions on how to ignore specific rule violations.
Rule Violation Summary
count tag profile rule associated tags
1 fqcn[action-core] production formatting
Failed after shared profile, 4/5 star rating: 1 failure(s), 0 warning(s) on 135 files.
You are using a pre-release version of ansible-lint. Note that a violation is found at |
ansible-lint version 6.16.2 is broken, ignoring exclude_path definitions[0]. Don't use it. [0] ansible/ansible-lint#3477 Signed-off-by: Dr. Jens Harbott <[email protected]>
ansible-lint version 6.16.2 is broken, ignoring exclude_path definitions[0]. Don't use it. [0] ansible/ansible-lint#3477 Signed-off-by: Dr. Jens Harbott <[email protected]>
Please point me to some repository where I can reproduce the bug, posting console dumps is not always enough for reproducing a bug. Quite often some other settings are triggering the bug. |
https://github.com/osism/ansible-playbooks/ is where I first discovered this. |
I was able to discover that I am not trying to get rid of the need to use wcmatch as we already have an utility function that is expected to test if a file path is excluded or not. |
I just pushed a rewrite of detection location that drops use of wcmatch, please test #3487 and report the outcomes. This impacts case where linter is called without any positional arguments in locations that are not git repos. |
Works for me, too. Note that in my case the invocation is indeed without pos args, but in the root of a git repo. Also while testing I found that despite having e.g. |
@ssbarnea : I can confirm that the fix will work for me as well |
Summary
ansible-lint is linting excluded paths since 6.16.2
Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
.ansible-lint
ansible-lint
and see it lint the collectionsWith ansible-lint 6.16.1 (normal)
With ansible-lint 6.16.2 (bug)
Desired Behavior
Excluded paths should be excluded from linting
Actual Behavior
Excluded paths are linted
The text was updated successfully, but these errors were encountered: