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

yamllint: Disable document-start by default #1422

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

adrienverge
Copy link
Contributor

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

yamllint_configs['rules']['document-start']['present'] = True
if document_start is not None:
yamllint_configs['rules']['document-start'] = {
'present': document_start}
Copy link
Member

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 :)

@Makman2
Copy link
Member

Makman2 commented Feb 8, 2017

Commit message:

When you want to make use of auto-close features of GitHub, don't place a colon:

Closes xxxx
instead of
Closes: xxxx

also the "Fixed" issues are already closed, and this commit does not really "fix" them. You could write Related to xxxx if you want to refer those :)

@Makman2
Copy link
Member

Makman2 commented Feb 8, 2017

Also if you want to work on an issue @adrienverge, tell us so we can assign you and nobody's doing double-work :)
(or come by at gitter and assign yourself with cobot assign <link-to-issue> :D)

@adrienverge
Copy link
Contributor Author

For the sake of readability I think this is better:

You're totally right, thanks! Updated.

When you want to make use of auto-close features of GitHub, don't place a colon:

GitHub works fine with colons, but I removed them if you prefer this way.

also the "Fixed" issues are already closed

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.

@Makman2
Copy link
Member

Makman2 commented Feb 8, 2017

GitHub works fine with colons, but I removed them if you prefer this way.

Oh really? Sorry then :3

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.

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
@adrienverge adrienverge force-pushed the fix/yamllint-document-start branch from a7a09c9 to 064abf4 Compare February 8, 2017 18:43
@adrienverge
Copy link
Contributor Author

Don't want to be nitpicking, but for those "Fixes xxx" issues I would insist that you change them to "Related to xxx" ^^

Alright, done.

@Makman2
Copy link
Member

Makman2 commented Feb 8, 2017

ack 064abf4

@Makman2
Copy link
Member

Makman2 commented Feb 8, 2017

@rultor merge

@rultor
Copy link

rultor commented Feb 8, 2017

@rultor merge

@Makman2 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 064abf4 into coala:master Feb 8, 2017
@rultor
Copy link

rultor commented Feb 8, 2017

@rultor merge

@Makman2 Done! FYI, the full log is here (took me 1min)

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

Successfully merging this pull request may close these issues.

4 participants