AllCops: # Default formatter will be used if no -f/--format option is given. DefaultFormatter: progress # Cop names are not displayed in offense messages by default. Change behavior # by overriding DisplayCopNames, or by giving the -D/--display-cop-names # option. DisplayCopNames: true # Style guide URLs are not displayed in offense messages by default. Change # behavior by overriding DisplayStyleGuide, or by giving the # -S/--display-style-guide option. DisplayStyleGuide: true # Extra details are not displayed in offense messages by default. Change # behavior by overriding ExtraDetails, or by giving the # -E/--extra-details option. ExtraDetails: true # Additional cops that do not reference a style guide rule may be enabled by # default. Change behavior by overriding StyleGuideCopsOnly, or by giving # the --only-guide-cops option. StyleGuideCopsOnly: false # All cops except the ones in disabled.yml are enabled by default. Change # this behavior by overriding DisabledByDefault. When DisabledByDefault is # true, all cops in the default configuration are disabled, and and only cops # in user configuration are enabled. This makes cops opt-in instead of # opt-out. Note that when DisabledByDefault is true, cops in user # configuration will be enabled even if they don't set the Enabled parameter. DisabledByDefault: true # Enables the result cache if true. Can be overridden by the --cache command # line option. UseCache: true # Threshold for how many files can be stored in the result cache before some # of the files are automatically removed. MaxFilesInCache: 20000 # The cache will be stored in "rubocop_cache" under this directory. The name # "/tmp" is special and will be converted to the system temporary directory, # which is "/tmp" on Unix-like systems, but could be something else on other # systems. CacheRootDirectory: /tmp # The default cache root directory is /tmp, which on most systems is # writable by any system user. This means that it is possible for a # malicious user to anticipate the location of Rubocop's cache directory, # and create a symlink in its place that could cause Rubocop to overwrite # unintended files, or read malicious input. If you are certain that your # cache location is secure from this kind of attack, and wish to use a # symlinked cache location, set this value to "true". # AllowSymlinksInCacheRootDirectory: false # What version of the Ruby interpreter is the inspected code intended to # run on? (If there is more than one, set this to the lowest version.) TargetRubyVersion: 1.9 Exclude: - 'vendor/**/*' - 'db/**/*' - 'tmp/**/*' - 'bin/**/*' - 'spec/**/*' - 'test/**/*' - 'script/**/*' - 'lib/templates/**/*' - 'doc/**/*' # Commonly used screens these days easily fit more than 80 characters. Metrics/LineLength: Max: 120 Enabled: false # Too short methods lead to extraction of single-use methods, which can make # the code easier to read (by naming things), but can also clutter the class Metrics/MethodLength: Max: 20 Enabled: false # The guiding principle of classes is SRP, SRP can't be accurately measured by LoC Metrics/ClassLength: Max: 1500 # Single quotes being faster is hardly measurable and only affects parse time. # Enforcing double quotes reduces the times where you need to change them # when introducing an interpolation. Use single quotes only if their semantics # are needed. Style/StringLiterals: EnforcedStyle: double_quotes Enabled: false # We do not need to support Ruby 1.9, so this is good to use. Style/SymbolArray: Enabled: false # Most readable form. Style/AlignHash: EnforcedHashRocketStyle: table EnforcedColonStyle: table # Enabled: false # Mixing the styles looks just silly. Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys Enabled: false # has_key? and has_value? are far more readable than key? and value? # Style/DeprecatedHashMethods: # Enabled: false # String#% is by far the least verbose and only object oriented variant. Style/FormatString: EnforcedStyle: percent Style/CollectionMethods: PreferredMethods: # inject seems more common in the community. reduce: "inject" map: "collect" # Enabled: false # Either allow this style or don't. Marking it as safe with parenthesis # is silly. Let's try to live without them for now. Style/ParenthesesAroundCondition: AllowSafeAssignment: false Enabled: false Lint/AssignmentInCondition: AllowSafeAssignment: false Enabled: false # A specialized exception class will take one or more arguments and construct the message from it. # So both variants make sense. # Style/RaiseArgs: # Enabled: false # Indenting the chained dots beneath each other is not supported by this cop, # see https://github.com/bbatsov/rubocop/issues/1633 # Style/MultilineOperationIndentation: # Enabled: false # Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain. # The argument that fail should be used to abort the program is wrong too, # there's Kernel#abort for that. Style/SignalException: EnforcedStyle: only_raise # Suppressing exceptions can be perfectly fine, and be it to avoid to # explicitly type nil into the rescue since that's what you want to return, # or suppressing LoadError for optional dependencies Lint/HandleExceptions: Enabled: false Style/SpaceInsideBlockBraces: # The space here provides no real gain in readability while consuming # horizontal space that could be used for a better parameter name. # Also {| differentiates better from a hash than { | does. SpaceBeforeBlockParameters: false # Enabled: false # No trailing space differentiates better from the block: # foo} means hash, foo } means block. Style/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space # Enabled: false # { ... } for multi-line blocks is okay, follow Weirichs rule instead: # https://web.archive.org/web/20140221124509/http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc Style/BlockDelimiters: Enabled: false # do / end blocks should be used for side effects, # methods that run a block for side effects and have # a useful return value are rare, assign the return # value to a local variable for those cases. Style/MethodCalledOnDoEndBlock: Enabled: true # Enforcing the names of variables? To single letter ones? Just no. Style/SingleLineBlockParams: Enabled: false # Shadowing outer local variables with block parameters is often useful # to not reinvent a new name for the same thing, it highlights the relation # between the outer variable and the parameter. The cases where it's actually # confusing are rare, and usually bad for other reasons already, for example # because the method is too long. Lint/ShadowingOuterLocalVariable: Enabled: false # Check with yard instead. Style/Documentation: Enabled: false # This is just silly. Calling the argument `other` in all cases makes no sense. Style/OpMethod: Enabled: false # There are valid cases, for example debugging Cucumber steps, # also they'll fail CI anyway Lint/Debugger: Enabled: false # Style preference Style/MethodDefParentheses: Enabled: false Style/EmptyLinesAroundBlockBody: EnforcedStyle: empty_lines Enabled: false Style/EmptyLinesAroundClassBody: EnforcedStyle: empty_lines # Enabled: false Style/EmptyLinesAroundModuleBody: EnforcedStyle: empty_lines # Enabled: false