Skip to content

Add additional default search paths for the config file #2072

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

Closed
wants to merge 1 commit into from

Conversation

MarkusTeufelberger
Copy link

Resolves the feature request in #2056

I didn't change

# .config/ansible-lint.yml
and rather added a line in the documentation that this is the canonical location so other than the cli help text for -c it should be enough to only reference that location.

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I am against this change because it adds complexity and affects loading speed. I do not think that we need to support some many variations.

Keep in mind that any change in that are is likely to need updates for other tools that are looking for config, like IDE extensions. It can have a cascading effect.

Still, I will not use any veto powers to block it, so I will wait for more feedback before making a decision.

@MarkusTeufelberger
Copy link
Author

I'll update https://github.com/ansible/schemas next (the path there is wrong anyways)

@septatrix
Copy link

To be honest I am against this change because it adds complexity and affects loading speed. I do not think that we need to support some many variations.

Honestly I am very confused why $PWD/.config/ansible-lint.yml is even checked as tools usually only look into ~/.config for global stuff and repo-local config is always in the repo root. Regarding the speed there are many tools which look for a multitude of config files like flake8 (setup.cfg, tox.ini, .flake8), isort (.isort.cfg, pyproject.toml, setup.cfg, tox.ini, .editorconfig) etc. though I am not sure if they also traverse the parent directory until they found a file or only look into the current directory (which I think would be sufficient most of the time).

If you still think that these are too many I would also be fine with only supporting .ansible-lint, .ansible-lint.yml and .config/ansible-lint.yml. I very much have an aversion to the .config dir in the repo root and my editor either does not detect the language in .ansible-lint or thinks it is Markdown.

Keep in mind that any change in that are is likely to need updates for other tools that are looking for config, like IDE extensions. It can have a cascading effect.

I do not know of any tool to which this would apply. IDE extensions simply call ansible-lint from the root of the opened directory and parse its result.

@MarkusTeufelberger
Copy link
Author

As an additional data point: yamllint looks into the following locations for its config file (taking the first one it finds):

  • .yamllint, .yamllint.yaml or .yamllint.yml in the current working directory
  • the file referenced by $YAMLLINT_CONFIG_FILE, if set
  • $XDG_CONFIG_HOME/yamllint/config
  • ~/.config/yamllint/config

Source: https://yamllint.readthedocs.io/en/stable/configuration.html

@ssbarnea
Copy link
Member

For the moment we will not add support for additional configuration filenames.

@ssbarnea ssbarnea closed this Apr 29, 2022
@MarkusTeufelberger
Copy link
Author

Why did you not tell me this in the feature request that was open for about 2 weeks before I did this pull request? What changed in the past 2 weeks that this gets now denied? This is frustrating.

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

Successfully merging this pull request may close these issues.

3 participants