Skip to content
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

Feature request: shorter syntax for "no rules" #72

Closed
sparr opened this issue Sep 20, 2017 · 3 comments
Closed

Feature request: shorter syntax for "no rules" #72

sparr opened this issue Sep 20, 2017 · 3 comments

Comments

@sparr
Copy link

sparr commented Sep 20, 2017

I want to run yamllint without any "style" rules, breaking only on syntax errors. The shortest way I've found to do that is yamllint -d "{rules:{}}" file.yaml which took me a few tries to get right and seems overly verbose.

It would be nice if an empty config file or -d "" would work, or even if there was a command line option to disable all rules.

@adrienverge
Copy link
Owner

Hi,

What about yamllint -d syntax-only file.yaml?

It could be achieved by creating a config file (yamllint/conf/syntax-only.yaml) in this repo.

@adrienverge
Copy link
Owner

I'm closing this because yamllint -d "{rules:{}}" is simple to use.

@sparr
Copy link
Author

sparr commented Dec 12, 2022

which took me a few tries to get right

yamllint --help says

  -d CONFIG_DATA, --config-data CONFIG_DATA
                        custom configuration (as YAML source)

but it wasn't obvious to me at the time what would make for a minimal valid set of configuration data to produce the desired result. I can't remember what I tried then, but today I tried...

  • an empty string "", which was invalid config: not a dict
  • an empty dict "{}", which throws a TypeError, which is possibly issue-worthy itself, since I'd expect it to be caught and reported as another invalid config
  • a dict with a useless key "{a:}", which works and I must have missed previously in looking more directly at rules-specific behavior

PS: "CONFIG_DATA" doesn't seem to appear in the online docs at all.

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

No branches or pull requests

2 participants