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

YAMLLintBear: Disable document-start rule by default #965

Merged
merged 1 commit into from
Nov 5, 2016

Conversation

refeed
Copy link
Member

@refeed refeed commented Oct 31, 2016

Disable YAMLLint rule document-start by default because
many YAML files have no need for start and end markers, but
user still can enable it by using document_start=true
setting.

Add unit tests for YAMLLintBear.

Closes #923

@gitmate-bot
Copy link
Collaborator

Thanks for your contribution!

Reviewing pull requests take really a lot of time and we're all volunteers. Please make sure you go through the following check list and complete them all before pinging someone for a review.

As you learn things over your Pull Request please help others on the chat and on PRs to get their stuff right as well!

@gitmate-bot
Copy link
Collaborator

Comment on 1751d74.

Shortlog of HEAD commit is 4 character(s) longer than the limit (54 > 50).

GitCommitBear, severity NORMAL, section commit.

'''
:param document_start:
Use this rule to require or forbid the use of document start
marker (---).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains following spacing inconsistencies:

  • Tabs used instead of spaces.

SpaceConsistencyBear, severity NORMAL, section python.

The issue can be fixed by applying the following patch:

--- a/bears/yml/YAMLLintBear.py
+++ b/bears/yml/YAMLLintBear.py
@@ -27,7 +27,7 @@
         '''
         :param document_start:
            Use this rule to require or forbid the use of document start
-           marker (---).
+            marker (---).
         '''
         yamllint_configs = {'extends': 'default',
                             'rules':

document_start: bool=False):
'''
:param document_start:
Use this rule to require or forbid the use of document start
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains following spacing inconsistencies:

  • Tabs used instead of spaces.

SpaceConsistencyBear, severity NORMAL, section python.

The issue can be fixed by applying the following patch:

--- a/bears/yml/YAMLLintBear.py
+++ b/bears/yml/YAMLLintBear.py
@@ -26,7 +26,7 @@
                         document_start: bool=False):
         '''
         :param document_start:
-           Use this rule to require or forbid the use of document start
+            Use this rule to require or forbid the use of document start
            marker (---).
         '''
         yamllint_configs = {'extends': 'default',

yamllint_configs = {'extends': 'default',
'rules':
{'document-start':
{'present': False}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/bears/yml/YAMLLintBear.py
+++ b/bears/yml/YAMLLintBear.py
@@ -32,9 +32,9 @@
         yamllint_configs = {'extends': 'default',
                             'rules':
                                 {'document-start':
-                                     {'present': False}
-                                }
-                           }
+                                 {'present': False}
+                                 }
+                            }
         if document_start:
             yamllint_configs['rules']['document-start']['present'] = True

document_start: bool=False):
'''
:param document_start:
Use this rule to require or forbid the use of document start
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/bears/yml/YAMLLintBear.py
+++ b/bears/yml/YAMLLintBear.py
@@ -26,8 +26,8 @@
                         document_start: bool=False):
         '''
         :param document_start:
-           Use this rule to require or forbid the use of document start
-           marker (---).
+                Use this rule to require or forbid the use of document start
+                marker (---).
         '''
         yamllint_configs = {'extends': 'default',
                             'rules':

@Adrianzatreanu
Copy link
Contributor

hey this is unreviewable with so many gitmate issues, could you fix them? simply running coala on your machine will fix everything for you :)

@sils
Copy link
Member

sils commented Nov 5, 2016

Oy! I like this! b48311d is ready

@sils
Copy link
Member

sils commented Nov 5, 2016

@rafidaslam if you rebase this we can merge it, here are the rebase instructions just in case you need them:


Hi,

it looks like your PR is out of date and needs a rebase. This page may help you to get started on this. (Do not press the update branch button. It's evil.)

Add the original coala repository as a remote:

git remote add upstream https://github.com/coala/coala-bears.git

Then go to your branch and rebase it onto our master:

git checkout <yourbranch>
git fetch upstream
git rebase --interactive upstream/master

Now push it up. You will need to do a force push because you change history here (do not do this on master branches :)):

git push --force

If you're just looking to fix an issue very quickly and not interested in contributing to coala long term, we can fix it up for you - just tell us :).

Ping us on our gitter channel if you need help!

Disable YAMLLint rule `document-start` by default because
many YAML files have no need for start and end markers, but
user still can enable it by using `document_start=true`
setting.

Closes coala#923
@refeed
Copy link
Member Author

refeed commented Nov 5, 2016

@sils rebased :)

@AsnelChristian
Copy link
Member

ack 5c5a6e1

1 similar comment
@AsnelChristian
Copy link
Member

ack 5c5a6e1

@AsnelChristian
Copy link
Member

@rultor merge

@rultor
Copy link

rultor commented Nov 5, 2016

@rultor merge

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

@rultor rultor merged commit 5c5a6e1 into coala:master Nov 5, 2016
@rultor
Copy link

rultor commented Nov 5, 2016

@rultor merge

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

adrienverge added a commit to adrienverge/coala-bears that referenced this pull request Feb 8, 2017
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
Fixes: coala#923 coala#965
adrienverge added a commit to adrienverge/coala-bears that referenced this pull request Feb 8, 2017
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
Fixes: coala#923 coala#965
adrienverge added a commit to adrienverge/coala-bears that referenced this pull request Feb 8, 2017
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
Fixes coala#923 coala#965
adrienverge added a commit to adrienverge/coala-bears that referenced this pull request Feb 8, 2017
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
gosom pushed a commit to gosom/coala-bears that referenced this pull request Jul 15, 2017
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
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.

6 participants