-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rubocop autocorrect all Ruby files, fail CI if warnings found (#172)
I want to require everyone to properly lint their files before merging to master to reduce bugs. Ideally, we would also automatically run `rubocop --autocorrect` on file save (easily achievable through an editor integration) so all our code has consistent style and conventions. So, this PR - updates to and requires the current latest RuboCop - removed some annoying code metric cops - turned on a few disabled cops I found useful - rubocop autocorrected all our Ruby files to fix our current warnings and prevent autocorrect from producing out-of-scope diffs in subsequent PRs - updated CI to fail builds if there are warning-level offenses detected Ideally, CI would also fail if there are autocorrectable offenses, even if not warning level, but I couldn't figure out how. I asked in rubocop/rubocop#12702 and will follow up once I get the answer. I will update our dev docs to make it clear we should be using RuboCop.
- Loading branch information
Showing
73 changed files
with
454 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
require: | ||
- rubocop-rails | ||
|
||
Style/Documentation: | ||
Rails/SkipsModelValidations: | ||
Enabled: false | ||
Rails/SaveBang: | ||
Enabled: true | ||
Style/CollectionMethods: | ||
Enabled: true | ||
Style/ClassAndModuleChildren: | ||
Enabled: false | ||
Style/FrozenStringLiteralComment: | ||
Style/Documentation: | ||
Enabled: false | ||
Style/StringLiterals: | ||
Enabled: false | ||
Style/SymbolArray: | ||
Enabled: false | ||
Style/WordArray: | ||
Enabled: false | ||
Layout/SpaceInsideHashLiteralBraces: | ||
Enabled: false | ||
Layout/LineLength: | ||
Max: 100 | ||
Max: 110 | ||
Metrics/MethodLength: | ||
Enabled: false | ||
Metrics/AbcSize: | ||
Enabled: false | ||
Metrics/CyclomaticComplexity: | ||
Enabled: false | ||
Metrics/BlockLength: | ||
Enabled: false | ||
Metrics/ClassLength: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
class GeneralController < ApplicationController | ||
|
||
def about | ||
end | ||
# frozen_string_literal: true | ||
|
||
def request_song | ||
end | ||
class GeneralController < ApplicationController | ||
def about; end | ||
|
||
end | ||
def request_song; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.