Skip to content

Commit

Permalink
[#25] Add rubocop config from bundler (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitboxer authored Oct 30, 2016
1 parent 0eec5e1 commit 398c76d
Show file tree
Hide file tree
Showing 18 changed files with 457 additions and 99 deletions.
123 changes: 123 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
inherit_from:
- .rubocop_todo.yml

AllCops:
TargetRubyVersion: 1.9
Exclude:
- tmp/**/*
- lib/bundler/vendor/**/*
- vendor/bundle/**/*
DisplayCopNames: true

# Lint

# They are idiomatic
Lint/AssignmentInCondition:
Enabled: false

Lint/EndAlignment:
AlignWith: variable
AutoCorrect: true

Lint/UnusedMethodArgument:
Enabled: false

# Style

Style/AccessModifierIndentation:
EnforcedStyle: outdent

Style/Alias:
EnforcedStyle: prefer_alias_method

Style/AlignParameters:
EnforcedStyle: with_fixed_indentation

Style/MultilineBlockChain:
Enabled: false

Style/MultilineOperationIndentation:
EnforcedStyle: indented

Style/PerlBackrefs:
Enabled: false

Style/SingleLineBlockParams:
Enabled: false

Style/SpaceInsideBlockBraces:
SpaceBeforeBlockParameters: false

Style/TrivialAccessors:
Enabled: false

# We adopted raise instead of fail.
Style/SignalException:
EnforcedStyle: only_raise

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingUnderscoreVariable:
Enabled: false

# `String.new` is preferred style with enabled frozen string literal
Style/EmptyLiteral:
Enabled: false

# 1.8.7 support

Style/Lambda:
Enabled: false

Style/DotPosition:
EnforcedStyle: trailing

Style/EachWithObject:
Enabled: false

Style/SpecialGlobalVars:
Enabled: false

Style/TrailingCommaInArguments:
Enabled: false

Performance/FlatMap:
Enabled: false

# Metrics

# We've chosen to use Rubocop only for style, and not for complexity or quality checks.
Metrics/ClassLength:
Enabled: false

Metrics/ModuleLength:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/BlockNesting:
Enabled: false

Metrics/AbcSize:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/ParameterLists:
Enabled: false

# It will be obvious which code is complex, Rubocop should only lint simple
# rules for us.
Metrics/PerceivedComplexity:
Enabled: false
248 changes: 248 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-07-27 12:41:39 -0500 using RuboCop version 0.41.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 4
Lint/Eval:
Exclude:
- 'lib/bundler.rb'
- 'lib/bundler/endpoint_specification.rb'
- 'spec/support/streams.rb'

# Offense count: 4
Lint/HandleExceptions:
Exclude:
- 'lib/bundler/installer.rb'
- 'lib/bundler/psyched_yaml.rb'
- 'lib/bundler/vendored_persistent.rb'

# Offense count: 1
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/bundler/settings.rb'

# Offense count: 3
Lint/NestedMethodDefinition:
Exclude:
- 'lib/bundler/inline.rb'
- 'spec/support/builders.rb'

# Offense count: 5
Lint/RescueException:
Exclude:
- 'lib/bundler/cli.rb'
- 'lib/bundler/dsl.rb'
- 'lib/bundler/friendly_errors.rb'
- 'lib/bundler/rubygems_integration.rb'
- 'lib/bundler/worker.rb'

# Offense count: 1
Lint/UselessAccessModifier:
Exclude:
- 'lib/bundler/fetcher.rb'

# Offense count: 6
Lint/UselessAssignment:
Exclude:
- 'lib/bundler/index.rb'
- 'lib/bundler/installer.rb'

# Offense count: 1686
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 207

# Offense count: 3
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 6

# Offense count: 6
# Cop supports --auto-correct.
Performance/RedundantBlockCall:
Exclude:
- 'lib/bundler/dsl.rb'
- 'lib/bundler/gem_helper.rb'
- 'lib/bundler/retry.rb'
- 'lib/bundler/shared_helpers.rb'
- 'spec/support/helpers.rb'

# Offense count: 2
# Cop supports --auto-correct.
Performance/RedundantMatch:
Exclude:
- 'lib/bundler/definition.rb'
- 'lib/bundler/lockfile_parser.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge:
Exclude:
- 'lib/bundler/cli/gem.rb'
- 'spec/support/helpers.rb'

# Offense count: 1
Style/AccessorMethodName:
Exclude:
- 'lib/bundler/source/git.rb'

# Offense count: 3
Style/CaseEquality:
Exclude:
- 'lib/bundler/dsl.rb'
- 'lib/bundler/match_platform.rb'
- 'lib/bundler/rubygems_ext.rb'

# Offense count: 23
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Enabled: false

# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'lib/bundler/cli.rb'
- 'lib/bundler/cli/gem.rb'
- 'lib/bundler/cli/lock.rb'
- 'lib/bundler/cli/platform.rb'
- 'lib/bundler/dsl.rb'
- 'lib/bundler/lazy_specification.rb'
- 'lib/bundler/psyched_yaml.rb'
- 'lib/bundler/rubygems_integration.rb'
- 'lib/bundler/source/git.rb'
- 'lib/bundler/source/rubygems.rb'

# Offense count: 138
Style/Documentation:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Style/ExtraSpacing:
Exclude:
- 'lib/bundler/cli.rb'

# Offense count: 4
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Exclude:
- 'lib/bundler/cli.rb'
- 'spec/spec_helper.rb'
- 'spec/support/helpers.rb'

# Offense count: 1
Style/IfInsideElse:
Exclude:
- 'lib/bundler/cli/install.rb'

# Offense count: 1
Style/IfUnlessModifierOfIfUnless:
Exclude:
- 'spec/support/helpers.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Style/IndentArray:
EnforcedStyle: consistent

# Offense count: 2
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: module_function, extend_self
Style/ModuleFunction:
Exclude:
- 'lib/bundler/shared_helpers.rb'
- 'spec/support/path.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented, indented_relative_to_receiver
Style/MultilineMethodCallIndentation:
Exclude:
- 'lib/bundler/cli/common.rb'
- 'spec/bundler/plugin/source_list_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/NestedParenthesizedCalls:
Exclude:
- 'lib/bundler/resolver.rb'
- 'spec/commands/lock_spec.rb'
- 'spec/runtime/setup_spec.rb'

# Offense count: 9
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Exclude:
- 'spec/**/*'
- 'lib/bundler/definition.rb'
- 'lib/bundler/installer/parallel_installer.rb'
- 'lib/bundler/settings.rb'
- 'lib/bundler/source/git.rb'
- 'lib/bundler/source/git/git_proxy.rb'
- 'lib/bundler/source/path.rb'

# Offense count: 25
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantParentheses:
Exclude:
- 'lib/bundler/cli/console.rb'
- 'lib/bundler/dsl.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Style/SpaceAroundOperators:
Exclude:
- 'lib/bundler/retry.rb'

# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
# SupportedStyles: comma, consistent_comma, no_comma
Style/TrailingCommaInLiteral:
Exclude:
- 'lib/bundler/cli/gem.rb'
- 'lib/bundler/dependency.rb'
- 'lib/bundler/fetcher.rb'
- 'lib/bundler/gem_helpers.rb'
- 'lib/bundler/graph.rb'
- 'lib/bundler/ruby_version.rb'
- 'lib/bundler/similarity_detector.rb'
- 'spec/support/artifice/endpoint.rb'

# Offense count: 18
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/bundler/cli/config.rb'
- 'lib/bundler/env.rb'
- 'spec/bundler/shared_helpers_spec.rb'
- 'spec/cache/git_spec.rb'
- 'spec/commands/exec_spec.rb'
- 'spec/support/artifice/endpoint.rb'
- 'spec/support/artifice/endpoint_500.rb'
- 'spec/support/fakeweb/windows.rb'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gemspec
Loading

0 comments on commit 398c76d

Please sign in to comment.