-
Notifications
You must be signed in to change notification settings - Fork 670
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
Ansible Lint fails to recognise yamllint installed by Homebrew on macOS #1722
Comments
@jamesquilty typically, the executable lookup relies on the |
@webknjaz Yes, |
@jamesquilty could you paste the output of |
@konstruktoid Sure, no probs. $ which yamllint && echo $PATH
/usr/local/bin/yamllint
/Users/<username>/.pyenv/shims:/usr/local/opt/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Users/<username>/.gem/ruby/3.0.0/bin The situation is that there are more than 30 users, running macOS, Windows and Linux, using ansible-lint on closely related repos. Some users' development environments are maintained by a sysadmin, so they have limited control of environment configuration. If ansible-lint behaves differently in different environments, then that's a problem - it's unfair to be told that your code contains linting rule violations that you were never shown! I think that |
Closing as yamllint library is needed and presence or absence of executable does not affect linter behavior. The reason why yamllint is a soft-dependency is licensing. Making yamllint a full-dependency would force ansible-lint license to become GPL. |
The yamllint library certainly appears to be present in the brew install under That's not actually relevant, though. The actual problem is the "soft-dependency", so as I indicated above I'll create a separate issue for that. |
I am still hitting this, any workaround? |
@kphatak yes, I resolved several problems with Homebrew-installed Python packages by instead installing Python packages with |
There is a reason why brew install is not listed as supported installation! I love brew and use it every day, but I do not maintain a recipe for linter, mainly due to lack of time to update it. Brew is high maintenance in that area as they did not provide any way to automate the update of recipes and testing. If someone wants, they are more welcome to take care of this aspect. I guess that I will have to write a section about unsupported installers, like poetry and brew, to warn users. |
Summary
I've installed ansible-lint and yamllint with Homebrew on macOS, and also use an Arch Linux machine with ansible-lint installed (method unknown) and with yamllint installed by me using pip. I've found that ansible-lint reports yaml violations on Arch Linux machine but not on macOS. I think it's a fair conclusion that it's not finding yamllint at its brew-installed location
/usr/local/bin/yamllint
.Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
macOS 10.14.6 and 10.15.7
STEPS TO REPRODUCE
On macOS install via brew and try to lint a playbook with yaml rule violations. Assuming the working directory contains the playbook with violations
Desired Behaviour
ansible-lint should find the brew-installed yamllint and report yaml rule violations.
Actual Behaviour
Silent failure. This looks identical to "no rule violations" which makes it rather pernicious.
I think that the root of the problem is that, as of #953, ansible-lint sliently loses/acquires functionality depending on whether an external dependency (yamllint) can be found. That's a different issue.
The text was updated successfully, but these errors were encountered: