-
Notifications
You must be signed in to change notification settings - Fork 278
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
Provide a semantics-only configuration #219
base: master
Are you sure you want to change the base?
Conversation
* configure style rules as warnings * configure rules that can introduce semantic errors as errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dhutty, thanks for your contribution.
-
The rest of yamllint uses the term "syntax", which is also common in other tools. When a syntax problem occurs, it is reported as
syntax
(rule name). What aboutsyntax-only
instead ofsemantics-only
? -
The rule name says "semantics only" or "syntax only", but actually enables most rules (as warnings) and even enables
truthy
andkey-duplicates
as errors. Not very understandable for users.Instead, what about a
syntax-only
conf that disables all rules butsyntax
rule?The config file would be simple:
--- rules: []
|
||
.. code:: bash | ||
|
||
yamllint -d semantics-only file.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to simplify all this to something like:
If you want yamllint to only report syntax errors, use the pre-defined
configuration named ``syntax-only``:
.. code:: bash
yamllint -d syntax-only file.yaml
The reason I chose the word 'semantics' was to emphasize that if yamllint exited with an error, it means that the YAML being tested might be semantically different from what the user intended as opposed merely being stylistically/conventionally problematic. In order words, my proposed |
See #72