-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace style guide with one based on Thoughtbot's
Copy metrics cops settings and some other most basic configuration to .rubocop.ribose.yml, and inherit everything else from Thoughtbot's style guide. Replace old, unmanageable monolithic style guide with a versioned reference to our style guide.
- Loading branch information
Showing
2 changed files
with
69 additions
and
1,073 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
inherit_from: | ||
- https://raw.githubusercontent.com/thoughtbot/guides/91509c26b3f84beebb239592561e41a77fdd0fa6/style/ruby/.rubocop.yml | ||
AllCops: | ||
Include: | ||
- "**/*.rake" | ||
- "**/Gemfile" | ||
- "**/*.gemfile" | ||
- "**/Rakefile" | ||
Exclude: | ||
- "vendor/**/*" | ||
- "db/**/*" | ||
- "tmp/**/*" | ||
DisplayCopNames: false | ||
StyleGuideCopsOnly: false | ||
Rails: | ||
Enabled: true | ||
Metrics/AbcSize: | ||
Description: A calculated magnitude based on number of assignments, branches, and | ||
conditions. | ||
Enabled: true | ||
Max: 15 | ||
Metrics/BlockLength: | ||
Exclude: | ||
- "spec/**/*" | ||
Metrics/BlockNesting: | ||
Description: Avoid excessive block nesting | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count | ||
Enabled: true | ||
Max: 3 | ||
Metrics/ClassLength: | ||
Description: Avoid classes longer than 100 lines of code. | ||
Enabled: false | ||
CountComments: false | ||
Max: 100 | ||
Metrics/CyclomaticComplexity: | ||
Description: A complexity metric that is strongly correlated to the number of test | ||
cases needed to validate a method. | ||
Enabled: true | ||
Max: 6 | ||
Metrics/LineLength: | ||
Description: Limit lines to 80 characters. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits | ||
Enabled: true | ||
Max: 80 | ||
AllowURI: true | ||
URISchemes: | ||
- http | ||
- https | ||
Metrics/MethodLength: | ||
Description: Avoid methods longer than 10 lines of code. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods | ||
Enabled: true | ||
CountComments: true | ||
Max: 10 | ||
Exclude: | ||
- "spec/**/*" | ||
Metrics/ParameterLists: | ||
Description: Avoid long parameter lists. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params | ||
Enabled: true | ||
Max: 5 | ||
CountKeywordArgs: true | ||
Metrics/PerceivedComplexity: | ||
Description: A complexity metric geared towards measuring complexity for a human | ||
reader. | ||
Enabled: true | ||
Max: 7 |
Oops, something went wrong.