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

coalib/abstractions: Add LinterClass.py #4595

Merged
merged 2 commits into from Aug 2, 2017

Conversation

4 participants
@yash-nisar
Member

yash-nisar commented Jul 30, 2017

Introduce a virtual base class for linters and use it to
improve the check inside LocalBearTestHelper.
i.e. Instead of checking hasattr(cls, 'process_output'), an
isinstance(cls, LinterClass) is safer and easier to understand.

Closes #4594

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!

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Jul 30, 2017

Member

@Makman2 Cleaning up is left, but how does the overall PR look ?

Member

yash-nisar commented Jul 30, 2017

@Makman2 Cleaning up is left, but how does the overall PR look ?

Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
Show outdated Hide outdated coalib/testing/LocalBearTestHelper.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Jul 31, 2017

Updated @Makman2

Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
Show outdated Hide outdated coalib/bearlib/abstractions/LinterParent.py Outdated
@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2

Makman2 Jul 31, 2017

Member

Not sure about the commit message:

Replace `hasattr(cls, 'process_output')`

imo it should resemble this part of information you've described in the body:

an isinstance(cls, LinterParent) is safer and easier to understand

Member

Makman2 commented Jul 31, 2017

Not sure about the commit message:

Replace `hasattr(cls, 'process_output')`

imo it should resemble this part of information you've described in the body:

an isinstance(cls, LinterParent) is safer and easier to understand

@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2

Makman2 Jul 31, 2017

Member

Both issues close the same issue, that's technically not possible. If both are a part of the issue, write inside the PR message that it closes the issue, and inside the commits refer to the issue with Related to ...

Member

Makman2 commented Jul 31, 2017

Both issues close the same issue, that's technically not possible. If both are a part of the issue, write inside the PR message that it closes the issue, and inside the commits refer to the issue with Related to ...

@yash-nisar yash-nisar changed the title from coalib/abstractions: Add LinterParent.py to coalib/abstractions: Add LinterClass.py Jul 31, 2017

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Aug 1, 2017

Updated @Makman2

Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
Show outdated Hide outdated coalib/bearlib/abstractions/LinterClass.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Aug 2, 2017

Updated @Makman2

Show outdated Hide outdated coalib/bearlib/abstractions/LinterClass.py Outdated
Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
Show outdated Hide outdated coalib/bearlib/abstractions/Linter.py Outdated
@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2

Makman2 Aug 2, 2017

Member

ack f52a849 284635c

Member

Makman2 commented Aug 2, 2017

ack f52a849 284635c

yash-nisar added some commits Jul 30, 2017

coalib/abstractions: Add LinterClass.py
Introduce a virtual base class for linters and use it to
improve the check inside `LocalBearTestHelper`.
i.e. Instead of checking `hasattr(cls, 'process_output')`, an
`isinstance(cls, LinterClass)` is safer and easier to understand.

Related to #4594
Introduce `isinstance(cls, LinterClass)`
Replace `hasattr(cls, 'process_output')` by
`isinstance(cls, LinterClass)` in `LocalBearTestHelper`.
Instead of checking `hasattr(cls, 'process_output')`, an
`isinstance(cls, LinterClass)` is safer and easier to understand.

Related to #4594
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Aug 2, 2017

@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2

Makman2 Aug 2, 2017

Member

@rultor merge

Member

Makman2 commented Aug 2, 2017

@rultor merge

@rultor

This comment has been minimized.

Show comment
Hide comment
@rultor

rultor Aug 2, 2017

Contributor

@rultor merge

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

Contributor

rultor commented Aug 2, 2017

@rultor merge

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

@rultor rultor merged commit 2816dc6 into coala:master Aug 2, 2017

6 of 9 checks passed

ci/circleci CircleCI is running your tests
Details
continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
codecov/project 100% (target 100%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
review/gitmate/commit This commit has no issues. :)
Details
review/gitmate/manual This commit was acknowledged.
Details
review/gitmate/pr This PR has no issues. :)
Details
@rultor

This comment has been minimized.

Show comment
Hide comment
@rultor

rultor Aug 2, 2017

Contributor

@rultor merge

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

Contributor

rultor commented Aug 2, 2017

@rultor merge

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

@yash-nisar yash-nisar deleted the yash-nisar:virtual-class branch Aug 2, 2017

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