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/c_languages: Add OClintBear #2149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bhavishyagopesh
Copy link
Contributor

@bhavishyagopesh bhavishyagopesh commented Dec 4, 2017

Adds OClintBear that provides static code analysis for C, C++ and
Objective-C.

Closes #1953

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!

valid_files=(bad_file, good_file),
invalid_files=(),
settings={'oclint_cli_options': '-max-priority-1=2'})

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.

Origin: PEP8Bear, Section: autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmp_di5qvhc/tests/c_languages/OClintBearTest.py
+++ b/tmp/tmp_di5qvhc/tests/c_languages/OClintBearTest.py
@@ -34,4 +34,3 @@
     valid_files=(bad_file, good_file),
     invalid_files=(),
     settings={'oclint_cli_options': '-max-priority-1=2'})
-

valid_files=(bad_file, good_file),
invalid_files=(),
settings={'oclint_cli_options': '-max-priority-1=2'})

Copy link
Collaborator

Choose a reason for hiding this comment

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

W391 blank line at end of file

Origin: PycodestyleBear (W391), Section: autopep8.

@staticmethod
def create_arguments(filename, file, config_file,
oclint_cli_options: str=''):

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.

Origin: PEP8Bear, Section: autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmp_di5qvhc/bears/c_languages/OClintBear.py
+++ b/tmp/tmp_di5qvhc/bears/c_languages/OClintBear.py
@@ -21,7 +21,6 @@
     @staticmethod
     def create_arguments(filename, file, config_file,
                          oclint_cli_options: str=''):
-
         """
         :param oclint_cli_options: Any other flags you wish to pass to oclint.
         """

OClintBear,
valid_files=(bad_file, good_file),
invalid_files=(),
settings={'oclint_cli_options': '-max-priority-1=2'})
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:

  • No newline at EOF.

Origin: SpaceConsistencyBear, Section: python.

The issue can be fixed by applying the following patch:

--- a/tmp/tmphvy4zy6p/tests/c_languages/OClintBearTest.py
+++ b/tmp/tmphvy4zy6p/tests/c_languages/OClintBearTest.py
@@ -33,4 +33,4 @@
     OClintBear,
     valid_files=(bad_file, good_file),
     invalid_files=(),
-    settings={'oclint_cli_options': '-max-priority-1=2'})+    settings={'oclint_cli_options': '-max-priority-1=2'})

OClintBear,
valid_files=(bad_file, good_file),
invalid_files=(),
settings={'oclint_cli_options': '-max-priority-1=2'})
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.

Origin: PEP8Bear, Section: autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmphvy4zy6p/tests/c_languages/OClintBearTest.py
+++ b/tmp/tmphvy4zy6p/tests/c_languages/OClintBearTest.py
@@ -33,4 +33,4 @@
     OClintBear,
     valid_files=(bad_file, good_file),
     invalid_files=(),
-    settings={'oclint_cli_options': '-max-priority-1=2'})+    settings={'oclint_cli_options': '-max-priority-1=2'})

OClintBear,
valid_files=(bad_file, good_file),
invalid_files=(),
settings={'oclint_cli_options': '-max-priority-1=2'})
Copy link
Collaborator

Choose a reason for hiding this comment

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

W292 no newline at end of file

Origin: PycodestyleBear (W292), Section: autopep8.

@bhavishyagopesh bhavishyagopesh force-pushed the fix/issue-1953 branch 2 times, most recently from 8c6a7fa to ff5d0ef Compare December 4, 2017 08:40
Copy link
Contributor

@newbazz newbazz left a comment

Choose a reason for hiding this comment

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

Always run coala before making a PR.

@bhavishyagopesh
Copy link
Contributor Author

bhavishyagopesh commented Dec 4, 2017

@jayvdb / @Makman2 Is it failing due to absence of oclint or test coverage is really limited?
also I guess ssss means skip...

Copy link
Member

@khanchi97 khanchi97 left a comment

Choose a reason for hiding this comment

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

It is failing because test coverage couldn't reach to 100% means you are missing some cases.

@bhavishyagopesh
Copy link
Contributor Author

@khanchi97 yeah, but it could be also because there is no oclint executable present.

@bhavishyagopesh bhavishyagopesh force-pushed the fix/issue-1953 branch 5 times, most recently from 86a6ad3 to 201b40b Compare December 7, 2017 16:26
GoLintBear,
valid_files=(good_file),
invalid_files=(),
settings={'oclint_cli_options': '-disable-rule=GOtoStatement'})
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:

  • No newline at EOF.

Origin: SpaceConsistencyBear, Section: python.

The issue can be fixed by applying the following patch:

--- a/tmp/tmp4o5fabpp/tests/c_languages/OClintBearTest.py
+++ b/tmp/tmp4o5fabpp/tests/c_languages/OClintBearTest.py
@@ -32,4 +32,4 @@
     GoLintBear,
     valid_files=(good_file),
     invalid_files=(),
-    settings={'oclint_cli_options': '-disable-rule=GOtoStatement'})+    settings={'oclint_cli_options': '-disable-rule=GOtoStatement'})

GoLintBear,
valid_files=(good_file),
invalid_files=(),
settings={'oclint_cli_options': '-disable-rule=GOtoStatement'})
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.

Origin: PEP8Bear, Section: autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmp4o5fabpp/tests/c_languages/OClintBearTest.py
+++ b/tmp/tmp4o5fabpp/tests/c_languages/OClintBearTest.py
@@ -32,4 +32,4 @@
     GoLintBear,
     valid_files=(good_file),
     invalid_files=(),
-    settings={'oclint_cli_options': '-disable-rule=GOtoStatement'})+    settings={'oclint_cli_options': '-disable-rule=GOtoStatement'})

GoLintBear,
valid_files=(good_file),
invalid_files=(),
settings={'oclint_cli_options': '-disable-rule=GOtoStatement'})
Copy link
Collaborator

Choose a reason for hiding this comment

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

W292 no newline at end of file

Origin: PycodestyleBear (W292), Section: autopep8.

@bhavishyagopesh bhavishyagopesh force-pushed the fix/issue-1953 branch 5 times, most recently from 2ca29f5 to 0a212ea Compare December 8, 2017 15:31
Adds `OClintBear` that provides static code analysis for C, C++ and
Objective-C.

Closes coala#1953
Copy link
Contributor

@newbazz newbazz left a comment

Choose a reason for hiding this comment

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

Read about pytest coverage and add some test cases ;P and rebase as well ;)

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.

Bear proposal: OclintBear
6 participants