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

bears/yaml: Add TravisLintBear #1879

Merged
merged 1 commit into from Jul 5, 2017
Merged

Conversation

yash-nisar
Copy link
Member

@yash-nisar yash-nisar commented Jul 1, 2017

Closes #294

For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!

Checklist

  • I read the commit guidelines and I've followed
    them.
  • I ran coala over my code locally. (All commits have to pass
    individually.
    It is not sufficient to have "fixup commits" on your PR,
    our bot will still report the issues for the previous commit.) You will
    likely receive a lot of bot comments and build failures if coala does not
    pass on every single commit!

After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.

Please consider helping us by reviewing other peoples pull requests as well:

The more you review, the more your score will grow at coala.io and we will
review your PRs faster!


@linter(executable='travis',
output_format='regex',
output_regex=r'\[x\]\s+(?P<message>.+)')
Copy link
Member

Choose a reason for hiding this comment

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

that's all information travis-lint provides? :/

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, even I did not like it at first, but there is no better alternative. See #294 (comment)

output_regex=r'\[x\]\s+(?P<message>.+)')
class TravisLintBear:
"""
A validator for your .travis.yml that attempts to reduce common build
Copy link
Member

Choose a reason for hiding this comment

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

maybe enclose .travis.yml in double backticks?

from coalib.testing.LocalBearTestHelper import LocalBearTestHelper
from coalib.testing.BearTestHelper import generate_skip_decorator
from coala_utils.ContextManagers import prepare_file

Copy link
Member

Choose a reason for hiding this comment

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

another newline plase ;) 2 newlines between imports and code 👍

repo: xyz/abc
ruby: 2.0.0
condition: "$(uname) = Linux"
"""
Copy link
Member

Choose a reason for hiding this comment

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

I think a separate file would be good.

repo: xyz/abc
ruby: 2.0.0
condition: "$(uname) = Linux"
"""
Copy link
Member

Choose a reason for hiding this comment

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

same here --> separate file

@yash-nisar
Copy link
Member Author

Updated @Makman2

secure: abcdef
gem: travis
on:
repo: xyz/abc
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 2 but found 4 (indentation)

YAMLLintBear, severity MAJOR, section yml.

api_key:
secure: abcdef
gem: travis
on:
Copy link
Collaborator

Choose a reason for hiding this comment

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

truthy value is not quoted (truthy)

YAMLLintBear, severity NORMAL, section yml.

deploy:
provider: rubygems
api_key:
secure: abcdef
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 2 but found 4 (indentation)

YAMLLintBear, severity MAJOR, section yml.

- rvm: jruby
os: osx
deploy:
provider: rubygems
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 0 but found 2 (indentation)

YAMLLintBear, severity MAJOR, section yml.

- linux
- osx
matrix:
exclude:
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 0 but found 2 (indentation)

YAMLLintBear, severity MAJOR, section yml.

secure: abcdef
gem: travis
on:
repo: xyz/abc
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 2 but found 4 (indentation)

YAMLLintBear, severity MAJOR, section yml.

api_key:
secure: abcdef
gem: travis
on:
Copy link
Collaborator

Choose a reason for hiding this comment

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

truthy value is not quoted (truthy)

YAMLLintBear, severity NORMAL, section yml.

deploy:
provider: rubygems
api_key:
secure: abcdef
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 2 but found 4 (indentation)

YAMLLintBear, severity MAJOR, section yml.

- rvm: jruby
os: osx
deploy:
provider: rubygems
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 0 but found 2 (indentation)

YAMLLintBear, severity MAJOR, section yml.

- linux
- osx
matrix:
exclude:
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong indentation: expected 0 but found 2 (indentation)

YAMLLintBear, severity MAJOR, section yml.

Copy link
Member

Choose a reason for hiding this comment

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

is YAMLLint insane?

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha drunk rather.

@yash-nisar
Copy link
Member Author

Damnit gitmate.


- invalid YAML
- missing language key
- unsupported runtime versions of Ruby, PHP, OTP, etc
Copy link
Member

Choose a reason for hiding this comment

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

etc.

import os
from queue import Queue

from bears.yaml.TravisLintBear import TravisLintBear
Copy link
Member

Choose a reason for hiding this comment

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

own package import ;)
below coalib imports with a newline in between ;)

@AsnelChristian
Copy link
Member

the KeywordBear is messing

class TravisLintBear:
"""
A validator for your ``.travis.yml`` that attempts to reduce common build
errors such as :
Copy link
Member

Choose a reason for hiding this comment

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

obsolete space between as and colon

@yash-nisar
Copy link
Member Author

Updated @Makman2

@Makman2
Copy link
Member

Makman2 commented Jul 5, 2017

ack 2f004bc

@Makman2
Copy link
Member

Makman2 commented Jul 5, 2017

@rultor merge

@rultor
Copy link

rultor commented Jul 5, 2017

@rultor merge

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

@rultor rultor merged commit 2f004bc into coala:master Jul 5, 2017
@rultor
Copy link

rultor commented Jul 5, 2017

@rultor merge

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

@yash-nisar yash-nisar deleted the travis-lint-bear branch July 5, 2017 14:36
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.

lint for travis yaml config file
6 participants