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

RuboCopBear: Fix CI breakage #1890

Merged
merged 1 commit into from Jul 6, 2017

Conversation

5 participants
@yash-nisar
Member

yash-nisar commented Jul 5, 2017

rubocop-hq/rubocop#4226 indicates that --stdin
takes filename as an argument which was incorporated. Also, the tests
were enhanced that involved the bear to be run on files with the .rb
(ruby) extension because initially the bear was run on the generated
temporary files that was the cause of error.

Fixes #1548

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!

@@ -36,7 +36,7 @@ class RuboCopBear:
def create_arguments(filename, file, config_file, rubocop_config: str=''):
# Need both stdin and filename. Explained in this comment:
# https://github.com/bbatsov/rubocop/pull/2146#issuecomment-131403694
args = (filename, '--stdin', '--format=json')
args = ('--stdin', filename, '--format=json')

This comment has been minimized.

@jayvdb

jayvdb Jul 5, 2017

Member

Is this change compatible with earlier versions of rubocop?

@jayvdb

jayvdb Jul 5, 2017

Member

Is this change compatible with earlier versions of rubocop?

This comment has been minimized.

@yash-nisar

yash-nisar Jul 5, 2017

Member

Yes 👍 , tested will versions 0.47.1, 0.48.1, 0.49.1

@yash-nisar

yash-nisar Jul 5, 2017

Member

Yes 👍 , tested will versions 0.47.1, 0.48.1, 0.49.1

good_file = """def good_name

This comment has been minimized.

@jayvdb

jayvdb Jul 5, 2017

Member

why do we need to move the text out into real filenames?

Does rubocop require that there is a valid file with this filename?

Cant LocalBearTestHelper create temporary files with an appropriate filename/extension?

If it cant, then writing tests is much harder, which is sort of the anti-thesis of your project.

@jayvdb

jayvdb Jul 5, 2017

Member

why do we need to move the text out into real filenames?

Does rubocop require that there is a valid file with this filename?

Cant LocalBearTestHelper create temporary files with an appropriate filename/extension?

If it cant, then writing tests is much harder, which is sort of the anti-thesis of your project.

This comment has been minimized.

@yash-nisar

yash-nisar Jul 5, 2017

Member

Yes, rubocop requires that we have a valid filename extension (.rb). Temporary files were created in the previous case when we had to use verify_local_bear(...) but without a valid extension. See the commit message.

@yash-nisar

yash-nisar Jul 5, 2017

Member

Yes, rubocop requires that we have a valid filename extension (.rb). Temporary files were created in the previous case when we had to use verify_local_bear(...) but without a valid extension. See the commit message.

This comment has been minimized.

@jayvdb

jayvdb Jul 5, 2017

Member

So, you need to improve LocalBearTestHelper :P

@jayvdb

jayvdb Jul 5, 2017

Member

So, you need to improve LocalBearTestHelper :P

This comment has been minimized.

@yash-nisar

yash-nisar Jul 5, 2017

Member

Actually, this is a linter specific problem. This is the first linter that I've come across that is careful about the filename extension. Moreover, it would make less sense IMO to improve LocalBearTestHelper to take care of this case only. Also we had to somehow improve the tests and use check_results(...) instead of verify_local_bear(...).

@yash-nisar

yash-nisar Jul 5, 2017

Member

Actually, this is a linter specific problem. This is the first linter that I've come across that is careful about the filename extension. Moreover, it would make less sense IMO to improve LocalBearTestHelper to take care of this case only. Also we had to somehow improve the tests and use check_results(...) instead of verify_local_bear(...).

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Jul 5, 2017

Member

@Makman2 Tagging you since this PR involved improvisation of tests.

Member

yash-nisar commented Jul 5, 2017

@Makman2 Tagging you since this PR involved improvisation of tests.

end_line=2,
end_column=20,
severity=RESULT_SEVERITY.INFO)],
filename=get_testfile_path(filename),

This comment has been minimized.

@Makman2

Makman2 Jul 5, 2017

Member

you should also check good files 👍

@Makman2

Makman2 Jul 5, 2017

Member

you should also check good files 👍

This comment has been minimized.

@yash-nisar

yash-nisar Jul 6, 2017

Member

Done 👍

@yash-nisar

yash-nisar Jul 6, 2017

Member

Done 👍

@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2

Makman2 Jul 5, 2017

Member

You could write into the commit message body that part of the fixing was to improve the tests.

Member

Makman2 commented Jul 5, 2017

You could write into the commit message body that part of the fixing was to improve the tests.

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Jul 6, 2017

Updated @Makman2

@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2
Member

Makman2 commented Jul 6, 2017

ack 51507c5

RuboCopBear: Fix CI breakage for version > 0.47.1
rubocop-hq/rubocop#4226 indicates that `--stdin`
takes filename as an argument which was incorporated. A part of the
fixing was to improve the tests that involved the bear to be run on
files with the `.rb`(ruby) extension because initially the bear was
run on the generated temporary files that was the cause of error.

Fixes #1548
@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2

Makman2 Jul 6, 2017

Member

reack d35b120

Member

Makman2 commented Jul 6, 2017

reack d35b120

@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2

Makman2 Jul 6, 2017

Member

@rultor merge

Member

Makman2 commented Jul 6, 2017

@rultor merge

@rultor

This comment has been minimized.

Show comment
Hide comment
@rultor

rultor Jul 6, 2017

@rultor merge

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

rultor commented Jul 6, 2017

@rultor merge

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

@rultor rultor merged commit d35b120 into coala:master Jul 6, 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 No issues with this one - go ahead! :)
Details
review/gitmate/manual This commit was acknowledged.
Details
review/gitmate/pr All is well! :) (0 problems solved)
Details
@rultor

This comment has been minimized.

Show comment
Hide comment
@rultor

rultor Jul 6, 2017

@rultor merge

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

rultor commented Jul 6, 2017

@rultor merge

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

@yash-nisar yash-nisar deleted the yash-nisar:rubocop-investigation branch Jul 6, 2017

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