-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from codeclimate/devon/update-rubocop-config-t…
…o-match-styleguide Update Rubocop config to match CC styleguide
- Loading branch information
Showing
6 changed files
with
115 additions
and
27 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,43 +1,120 @@ | ||
################################################################################ | ||
# Ruby Version | ||
################################################################################ | ||
|
||
AllCops: | ||
TargetRubyVersion: 2.2 | ||
Metrics/AbcSize: | ||
Enabled: false | ||
|
||
################################################################################ | ||
# Metrics | ||
################################################################################ | ||
|
||
Metrics/LineLength: | ||
Enabled: false | ||
|
||
Rails/TimeZone: | ||
Metrics/AbcSize: | ||
Enabled: false | ||
|
||
SignalException: | ||
Enabled: false | ||
################################################################################ | ||
# Style | ||
################################################################################ | ||
|
||
Style/StringLiterals: | ||
Enabled: false | ||
# Executables are conventionally named bin/foo-bar | ||
Style/FileName: | ||
Exclude: | ||
- bin/**/* | ||
|
||
# We don't (currently) document our code | ||
Style/Documentation: | ||
Enabled: false | ||
|
||
# Always use double-quotes to keep things simple | ||
Style/StringLiterals: | ||
EnforcedStyle: double_quotes | ||
|
||
# Use a trailing comma to keep diffs clean when elements are inserted or removed | ||
Style/TrailingCommaInLiteral: | ||
Enabled: false | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/ClassAndModuleChildren: | ||
Exclude: | ||
- 'spec/**/*' | ||
# We avoid GuardClause because it can result in "suprise return" | ||
Style/GuardClause: | ||
Enabled: false | ||
|
||
# We avoid IfUnlessModifier because it can result in "suprise if" | ||
Style/IfUnlessModifier: | ||
Enabled: false | ||
|
||
# We don't care about the fail/raise distinction | ||
Style/SignalException: | ||
EnforcedStyle: only_raise | ||
|
||
Style/DotPosition: | ||
EnforcedStyle: trailing | ||
|
||
# Common globals we allow | ||
Style/GlobalVars: | ||
AllowedVariables: | ||
- "$statsd" | ||
- "$mongo" | ||
- "$rollout" | ||
|
||
# Allow $! in config/initializers | ||
Style/SpecialGlobalVars: | ||
Exclude: | ||
- config/initializers/**/* | ||
|
||
# We have common cases where has_ and have_ make sense | ||
Style/PredicateName: | ||
Enabled: true | ||
NamePrefixBlacklist: | ||
- is_ | ||
|
||
# We use %w[ ], not %w( ) because the former looks like an array | ||
Style/PercentLiteralDelimiters: | ||
PreferredDelimiters: | ||
"%w": [] | ||
"%W": [] | ||
|
||
# Allow "trivial" accessors when defined as a predicate? method | ||
Style/TrivialAccessors: | ||
AllowPredicates: true | ||
|
||
Style/Next: | ||
Enabled: false | ||
|
||
Style/GuardClause: | ||
# We think it's OK to use the "extend self" module pattern | ||
Style/ModuleFunction: | ||
Enabled: false | ||
|
||
Style/StringLiteralsInInterpolation: | ||
################################################################################ | ||
# Rails - disable things because we're primarily non-rails | ||
################################################################################ | ||
|
||
Rails/Delegate: | ||
Enabled: false | ||
|
||
Style/PercentLiteralDelimiters: | ||
PreferredDelimiters: | ||
'%w': [] | ||
'%W': [] | ||
Rails/Output: | ||
Enabled: false | ||
|
||
Rails/TimeZone: | ||
Enabled: false | ||
|
||
################################################################################ | ||
# Specs - be more lenient on length checks and block styles | ||
################################################################################ | ||
|
||
Metrics/ModuleLength: | ||
Exclude: | ||
- spec/**/* | ||
|
||
Metrics/MethodLength: | ||
Exclude: | ||
- spec/**/* | ||
|
||
Style/ClassAndModuleChildren: | ||
Exclude: | ||
- spec/**/* | ||
|
||
Style/BlockDelimiters: | ||
Exclude: | ||
- spec/**/* |
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,4 +1,4 @@ | ||
require 'rspec/core/rake_task' | ||
require "rspec/core/rake_task" | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task default: :spec |
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