Skip to content

Commit

Permalink
bump rubocop version to latest, set min ruby to 2.5, enable new cops (#…
Browse files Browse the repository at this point in the history
…27)

* bump rubocop version to latest, set min ruby to 2.5, enable new cops
  • Loading branch information
Graham Paye authored Jan 27, 2021
1 parent ab0ff91 commit fc0eb09
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 11 deletions.
4 changes: 2 additions & 2 deletions google-style.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Gem::Specification.new do |gem|
gem.files = ["CONTRIBUTING.md", "CODE_OF_CONDUCT.md", "LICENSE",
"README.md", "google-style.yml"]

gem.required_ruby_version = ">= 2.4.0"
gem.required_ruby_version = ">= 2.5.0"

gem.add_dependency "rubocop", "~> 0.74.0"
gem.add_dependency "rubocop", "~> 1.8"
gem.add_development_dependency "bundler", "~> 2.0"
gem.add_development_dependency "rake", "~> 12.3"
end
64 changes: 55 additions & 9 deletions google-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,48 @@
# limitations under the License.

AllCops:
TargetRubyVersion: 2.4
Layout/AlignHash:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
SuggestExtensions: true
TargetRubyVersion: 2.5

Layout/EmptyLineAfterGuardClause:
Enabled: false
Layout/EmptyLines: # for the extra line between copyright and code
Enabled: false
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
Layout/LineLength:
Max: 120
Layout/SpaceBeforeBrackets:
Enabled: true
Lint/AmbiguousAssignment:
Enabled: true
Lint/DeprecatedConstants:
Enabled: true
Lint/DuplicateBranch:
Enabled: true
Lint/DuplicateRegexpCharacterClassElement:
Enabled: true
Lint/EmptyBlock:
Enabled: true
Lint/EmptyClass:
Enabled: true
Lint/LambdaWithoutLiteralBlock:
Enabled: true
Lint/NoReturnInBeginEndBlocks:
Enabled: true
Lint/RedundantDirGlobSort:
Enabled: true
Lint/ToEnumArguments:
Enabled: true
Lint/UnexpectedBlockArity:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Metrics/AbcSize:
Max: 30
Metrics/CyclomaticComplexity:
Max: 10
Metrics/LineLength:
Max: 120
Metrics/MethodLength:
Max: 25
Metrics/ParameterLists:
Expand All @@ -35,22 +63,40 @@ Metrics/PerceivedComplexity:
Max: 10
Naming/VariableNumber:
Enabled: false
Style/ArgumentsForwarding:
Enabled: true
Style/CollectionCompact:
Enabled: true
Style/DocumentDynamicEvalDefinition:
Enabled: true
Style/EmptyMethod:
EnforcedStyle: expanded
Style/EndlessMethod:
Enabled: true
Style/FrozenStringLiteralComment:
Enabled: false
Style/MethodCallWithArgsParentheses:
Style/HashExcept:
Enabled: true
EnforcedStyle: omit_parentheses
AllowParenthesesInMultilineCall: true
Style/MethodCallWithArgsParentheses:
AllowParenthesesInCamelCaseMethod: true
AllowParenthesesInChaining: true
AllowParenthesesInMultilineCall: true
Enabled: true
EnforcedStyle: omit_parentheses
Style/MethodDefParentheses:
EnforcedStyle: require_no_parentheses
Style/NegatedIfElseCondition:
Enabled: true
Style/NilLambda:
Enabled: true
Style/RedundantArgument:
Enabled: true
Style/RescueModifier:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/SwapValues:
Enabled: true
Style/SymbolArray:
EnforcedStyle: brackets
Style/TrivialAccessors:
Expand Down

0 comments on commit fc0eb09

Please sign in to comment.