-
Notifications
You must be signed in to change notification settings - Fork 581
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
yamllint: Disable document-start
by default
#1422
Conversation
bears/yaml/YAMLLintBear.py
Outdated
yamllint_configs['rules']['document-start']['present'] = True | ||
if document_start is not None: | ||
yamllint_configs['rules']['document-start'] = { | ||
'present': document_start} |
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.
For the sake of readability I think this is better:
...
'rules': {}
...
# Don't forget to wrap the line to meet the 80 chars limit :D
yamllint_configs['rules']['document-start'] = 'disable' if document_start is None else {'present': document_start}
Instead of patching the dict depending on a value, we directly assign the correct value :)
Commit message: When you want to make use of auto-close features of GitHub, don't place a colon:
also the "Fixed" issues are already closed, and this commit does not really "fix" them. You could write |
Also if you want to work on an issue @adrienverge, tell us so we can assign you and nobody's doing double-work :) |
576ab64
to
a7a09c9
Compare
You're totally right, thanks! Updated.
GitHub works fine with colons, but I removed them if you prefer this way.
I see a difference between "fixed" and "closed". My commit closes a discussion, but really fixes 1) the problem described in #923, 2) the other problem brought by commit in #965. |
Oh really? Sorry then :3
I think this is thought 3 corners around. Though those issues have not really identified the overall problem (by making the force-markers setting optional), they addressed a more specific issue which was itself solved by those other commits. Also we use "Fixes" specifically for fixing bugs (we actually track bug statistics via commits), and "Closes" for every other issue we want to close. Just you know :) Don't want to be nitpicking, but for those "Fixes xxx" issues I would insist that you change them to "Related to xxx" ^^ |
Some projects use documents starts (`---`) in YAML documents (for example Ansible, OpenStack, yamllint), others don't. Since these markers are required when declaring multiple documents in a single .yaml file (see the spec [1]), it is a bad idea to forbid them. This commit disables the `document-start` rule by default, instead of forcing / forbidding the use of these markers. [1]: http://yaml.org/spec/1.2/spec.html#id2800132 Closes coala#1417 Related to coala#923 and coala#965
a7a09c9
to
064abf4
Compare
Alright, done. |
ack 064abf4 |
@rultor merge |
Some projects use documents starts (
---
) in YAML documents (for example Ansible, OpenStack, yamllint), others don't. Since these markers are required when declaring multiple documents in a single .yaml file (see the spec), it is a bad idea to forbid them.This commit disables the
document-start
rule by default, instead of forcing / forbidding the use of these markers.Closes: #1417
Fixes: #923 #965