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

Bug solving sprint #747

Merged
merged 21 commits into from
Sep 3, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4f01f11
requirements: Remove setuptools
AbdealiLoKo Sep 2, 2016
5a4c5c2
GitCommitBear: Improve assertion empty queue
AbdealiLoKo Sep 2, 2016
241726c
GitCommitBear: Add ignore_length_regex setting
AbdealiLoKo Sep 2, 2016
4e5a4d8
LocalBearTestHelper: Return results for checking
AbdealiLoKo Sep 3, 2016
dc3d2ec
YapfBear: Catch parse errors and give result
AbdealiLoKo Sep 2, 2016
ae85d9d
YapfBear: Add prefer line break setting
AbdealiLoKo Sep 2, 2016
c24be59
ESLintBear: Update version of eslint
AbdealiLoKo Sep 3, 2016
6f685f4
MarkdownBear: Update version of remark
AbdealiLoKo Sep 3, 2016
138c7aa
CSSLintBear: Update csslint version
AbdealiLoKo Sep 3, 2016
600ba0b
AlexBear: Update alex version
AbdealiLoKo Sep 3, 2016
f8c00cd
KeywordBear: Simplify config for case sensitivity
AbdealiLoKo Sep 3, 2016
35140b4
KeywordBear: Conform to style guide
AbdealiLoKo Sep 3, 2016
bfd61fb
KeywordBear: Simplify and optimize using regex
AbdealiLoKo Sep 3, 2016
fa70e92
AlexBear: Check if wrong alex is installed
AbdealiLoKo Sep 3, 2016
22cdc8a
JSHintBear: Deprecate "use_es6_syntax"
AbdealiLoKo Aug 31, 2016
db8a2de
JSHintBear: Deprecate - "globalstrict" -> "strict"
AbdealiLoKo Aug 31, 2016
ee34cdc
bears.configfile: Add new bear - PuppetLintBear
AbdealiLoKo Sep 3, 2016
c60e9f5
ESLintBear: Handle corner case if eslint fails
AbdealiLoKo Sep 2, 2016
5c72d4e
requirements: Remove redundant comment abot nltk
AbdealiLoKo Sep 3, 2016
8a3d7fd
generate_packageTest: Use correct casing
AbdealiLoKo Sep 3, 2016
b3be8f3
natural_language: Add SpellCheckBear
mr-karan Jul 25, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ gem "rubocop"
gem "sqlint"
gem 'scss_lint', require: false# require flag is necessary https://github.com/brigade/scss-lint#installation
gem "reek"
gem "puppet-lint"
26 changes: 26 additions & 0 deletions bears/configfiles/PuppetLintBear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.GemRequirement import GemRequirement


@linter(executable='puppet-lint',
output_format='regex',
output_regex=r'(?P<line>\d+):(?P<column>\d+):'
r'(?P<severity>warning|error):(?P<message>.+)')
class PuppetLintBear:
'''
Check and correct puppet configuration files using ``puppet-lint``.

See <http://puppet-lint.com/> for details about the tool.
'''

LANGUAGES = {"Puppet"}
REQUIREMENTS = {GemRequirement('puppet-lint', '2')}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
LICENSE = 'AGPL-3.0'
CAN_FIX = {'Syntax'}
Copy link
Member

Choose a reason for hiding this comment

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

can you add an asciinema URL or file an issue about making one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


@staticmethod
def create_arguments(filename, file, config_file):
return ('--log-format', "%{line}:%{column}:%{kind}:%{message}",
filename)
17 changes: 17 additions & 0 deletions tests/configfiles/PuppetLintBearTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from bears.configfiles.PuppetLintBear import PuppetLintBear
from tests.LocalBearTestHelper import verify_local_bear

good_file = """
file { '/some.conf':
ensure => present,
}
"""

bad_file = """
# foo
class test::foo { }
"""

PuppetLintBearTest = verify_local_bear(PuppetLintBear,
valid_files=(good_file,),
invalid_files=(bad_file,))