-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Conversation
Thanks for opening a pull request and helping make Bundler better! Someone from the Bundler team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use Travis CI to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of Travis CI in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #bundler channel on Slack. For more information about contributing to the Bundler project feel free to review our CONTRIBUTING guide |
Oh wow, Travis is reporting this: I'm not exactly sure why, but even if bundler uses custom rules for their ruby code, the generated templates (for use in other projects), should be able to pass the default RuboCop rules, i.e. use single quotes unless you need string interpolation. Does anyone have suggestions how to achieve this? I assume bundler is using the custom rule for a reason. |
You will need configure Rubocop to skip the |
@@ -23,7 +23,7 @@ include: | |||
Examples of unacceptable behavior by participants include: | |||
|
|||
* The use of sexualized language or imagery and unwelcome sexual attention or | |||
advances | |||
advances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need 2 spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs two spaces because it's a continuation of the line above. Otherwise, some markdown implementation might interpret it as two separate lists (separated by the advances
line). See these warnings:
CODE_OF_CONDUCT.md:25: MD032 Lists should be surrounded by blank lines
CODE_OF_CONDUCT.md:27: MD032 Lists should be surrounded by blank lines
Check a few lines below (the last two bullet points) - they have the two spaces as well.
@colby-swandale Thanks for the comments! I'll try to amend the commit to make CI pass now! |
58d3a5a
to
e7bb3cb
Compare
Hmm okay, RuboCop is passing now, but there is a different CI error. I will check later how to fix it. |
☔ The latest upstream changes (presumably #6123) made this pull request unmergeable. Please resolve the merge conflicts. |
94e819d
to
d155ad3
Compare
ping @friederbluemle |
Sorry for the delay @colby-swandale - I'll work on it this weekend! |
d155ad3
to
e044bd4
Compare
☔ The latest upstream changes (presumably #6201) made this pull request unmergeable. Please resolve the merge conflicts. |
e044bd4
to
3b33ad0
Compare
@colby-swandale Again sorry for the super delayed response. I rebased my branch and made it mergeable again. However, Travis is still failing. I ran the tests locally (
The failures are definitely caused by my changes, as the master branch passes. Would you have a tip where I could start looking? Is it possible to only re-run the failed (or specific) tests, rather than the entire test suite? Thanks! |
|
Looking at the test failures, it looks like a lot of the expectations just need to be updated to expect the files to use single quotes |
3b33ad0
to
ac12ef5
Compare
Thanks a lot @segiddins - I managed to fix and successfully run all tests locally. There are only a few remaining errors with certain environment combinations now: https://travis-ci.org/bundler/bundler/builds/334670926 I will look into this later. |
Don't worry about the 2.5.0 failures, we've got a fix in the works for that already. |
@segiddins Okay sure thanks! I'll just rebase once the fixes are in 👍 |
ef5ec9d
to
87bee46
Compare
This fixes several rubocop and linter warnings, such as prefer usage of single-quoted strings when string interpolation is no needed, and lines that are too long.
87bee46
to
3dfffbc
Compare
For what it's worth, there's an analysis about usage of the The |
Is it still a necessity? When the rubocop changed This is out of scope of bundler. |
Thanks for the discussion, everyone! @hsbt it seems like Rubocop is not going to change their default, at least not right away, so we will need to pick a style and stick with it for ourselves. @deivid-rodriguez thank you for researching the project defaults, and I'm excited to see if Rubocop will change the default. :) @friederbluemle I super appreciate your work writing this PR! I love that you're doing the work to make sure that new gems will pass a linter right away after they've been generated. That said, Bundler (along with the other most popular Ruby projects and libraries) have all adopted double-quotes as their standard quotes. It was super observant to catch that we have single quotes on the Bundler homepage, and we should definitely change those to match the rest of the project. 👍 Because Bundler has chosen double quotes, I think we should resolve the underlying issue of new gems failing Rubocop by adding a rubocop config to generated gems that enables the double-quote rule. For our markdown files, it's great to see that you care about linting them as well. This PR will update the markdown files to pass On a slightly related note, the reason that I personally didn't want to enforce 80-char lines in the past is that inline markdown links get pretty silly-looking with an 80-char max. To fix that, I think we should probably migrate our markdown documentation files to use named links. For example,
I don't think rewriting the links in our existing markdown is a blocker to accepting this PR, though. Thanks again for all your work on this! |
☔ The latest upstream changes (presumably #6503) made this pull request unmergeable. Please resolve the merge conflicts. |
@friederbluemle Bundler repo was merged into rubygems. If you still interested in this PR, Can you re-open this on https://github.com/rubygems/rubygems? Thanks. |
This fixes several RuboCop warnings such as
Prefer single-quoted strings when you don't need string interpolation or special symbols. (Style/StringLiterals)
, as well as markdownlint warnings related to long lines. Line length should be limited to 80 chars according toMD013
.Bundler also suggests to use single-quoted strings in
Gemfile
right on the frontpage.What was the end-user problem that led to this PR?
The problem was that the default files generated by
bundle init
andbundle gem <newgem>
were causing RuboCop warnings (default configuration)What was your diagnosis of the problem?
My diagnosis was that the template files contained the described issues.
What is your fix for the problem, implemented in this PR?
My fix was to fix the RuboCop/Lint warnings.
Why did you choose this fix out of the possible options?
I chose this fix because there is no other fix (except using custom RuboCop rules or disabling them).