adrienverge / yamllint

A linter for YAML files.
GNU General Public License v3.0
2.79k stars 265 forks source link

option to print the configuration file path that is being used #667

Open bjt-user opened 3 months ago

bjt-user commented 3 months ago

Hello,

a

yamllint --config-path

or

yamllint -p

would be helpful to know where the config file is.

Or maybe a --verbose option that outputs the config file that is in play.

I had to use

pacman -Fl yamllint

and search through the output to find out that /usr/lib/python3.11/site-packages/yamllint/conf/default.yaml is responsible for the linting rules.

PS: How do I run/build/link this project? This did not work:

$ python3 __main__.py 
Traceback (most recent call last):
  File "/home/bf/workspace/git/yamllint/yamllint/__main__.py", line 16, in <module>
    from yamllint.cli import run
ModuleNotFoundError: No module named 'yamllint'
adrienverge commented 3 months ago

Hello,

I understand the need, but I'm not sure printing a file path would make sense, since yamllint can recursively aggregate multiple config files + command-line arguments to parse its configuration. Printing the whole configuration as text could be an option, but given the scarcity of this need, I doubt it's worth implementing it.

Most users probably search it on the web and find https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration

PS: How do I run/build/link this project?

I find that the easiest way to run yamllint from its source directory is:

PYTHONPATH=. python -m yamllint