-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix Rubocop offences #2272
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
Fix Rubocop offences #2272
Conversation
90e1f0e
to
c73a76a
Compare
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.
👋 Thanks for taking the time to contribute this, in order for this to make sense as a PR the rubocop check within out build needs to be changed to apply to the entire project. Currently we only apply the rules to lib
so if you'd like this merged it will need to be expanded to the whole project. Its in script/functions.sh
65b3ddc
to
b0ab808
Compare
hey @JonRowe 👋 glad to help! I updated Please, don't merge it right now, I would like to go through all cops, one per commit. |
fb6b07c
to
668be98
Compare
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.
Oh wow, it took me a while to look though it.
Do you mind fixing a couple more things along the way?
- mentions of
rubocop lib
inBUILD_DETAILS.md
andDEVELOPMENT.md
- https://github.com/bbatsov/rubocop => https://github.com/rubocop-hq/rubocop in
BUILD_DETAILS.md
- (minor, optional) in
script/after_update_travis_build.sh
we remove.rubocop_rspec_base.yml
which doesn't exist in this repo, is it needed?
I'm a bit concerned about disabling RedundantSelf
, Colon
, and weird new octal notation.
The rest of the comments are minor, I enjoy the new style, and would be happy to merge as-is.
Good job! 👏
Just an idea for a follow-up: we have some disabled cops in .rubocop_todo.yml
, some of them are due to Ruby 1.8 legacy, and it should be quite easy to fix them.
a21a7e2
to
68c001f
Compare
4cc0d69
to
bbd1b38
Compare
Updated from I can reproduce this locally:
fixed ✅ Regarding: group = RSpec::Core::ExampleGroup.describe do
include RequestExampleGroup
end.describe do
include FeatureExampleGroup
end and
wondering if this can be written as: group = RSpec::Core::ExampleGroup.describe do
include RequestExampleGroup
describe do
include FeatureExampleGroup
end
end will outer_group = RSpec::Core::ExampleGroup.describe do
include RequestExampleGroup
end
group = outer_group.describe do
include FeatureExampleGroup
end |
Checked, |
Looks green 👍 |
Layout/SpaceInsideBlockBraces: Layout/SpaceInsideBlockBraces: Reworked to use non-default |
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.
Just one thing to change @pirj
Offences count: space: 51 no_space: 1395
Offences count: with_first_argument: 13 with_fixed_indentation: 47
*disable Style/Semicolon cop inline *Update documentation *Remove useless deletion from travis script
*remove quoting from .rubocop.yml
*Rakefile comments
It is part of the benchmark
1b26d83
to
cec3d2e
Compare
* Fix Style/ExpandPathArguments cop * Layout/SpaceInsideBlockBraces Offences count: space: 51 no_space: 1395 * Style/PercentLiteralDelimiters * Gemspec/OrderedDependencies * Layout/ArgumentAlignment Offences count: with_first_argument: 13 with_fixed_indentation: 47 * Layout/BlockAlignment Offences count: either: 1 start_of_block: 4 start_of_line: 22 * Layout/ClosingHeredocIndentation * Layout/DotPosition Offences count: leading: 34 trailing: 1 * Layout/EmptyLineAfterGuardClause * Bundler/DuplicatedGem * Layout/EmptyLines * Layout/IndentationWidth * Layout/SpaceAfterComma * Layout/SpaceAroundEqualsInParameterDefault Offenses count: space: 3 no_space: 29 * Layout/SpaceBeforeBlockBraces Offenses count: space: 16 no_space: 52 * Layout/SpaceInsideHashLiteralBraces Offenses count: space: 73 no_space: 37 compact: 73 Set configuration for consistency: `no_space` for non empty braces `no_space` for empty braces * Layout/SpaceInsideParens Offenses count: space: 5311 no_space: 24 * Lint/AmbiguousBlockAssociation exclude `specs` folder * Lint/AmbiguousOperator exclude `Rakefile` * Lint/AmbiguousRegexpLiteral * Lint/DuplicateMethods * Lint/SuppressedException * Lint/UnderscorePrefixedVariableName * Lint/UnusedBlockArgument * Lint/UnusedMethodArgument * Metrics/ModuleLength * Metrics/ParameterLists * Naming/HeredocDelimiterCase * Style/BarePercentLiterals * Style/BracesAroundHashParameters * Style/ClassAndModuleChildren * Style/CommentedKeyword * Style/Encoding * Style/GlobalVars * Style/HashSyntax * Style/InverseMethods * Style/Lambda * Style/LineEndConcatenation * Style/NegatedIf * Style/NumericLiterals * Style/Proc * Style/RaiseArgs * Style/RedundantPercentQ * Style/Semicolon * Style/SingleLineMethods Use exclude since auto-correction causes spec fail: `rspec ./spec/rspec/rails_spec.rb:18` * Layout/LineLength * Style/NumericLiteralPrefix * Style/RedundantSelf * Style/EachWithObject * Style/PerlBackrefs Co-authored-by: Phil Pirozhkov <[email protected]>
No description provided.