-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/error-message
* master: (42 commits) Rubocop: Silence Style/IfUnlessModifier Rubocop: Silence Lint/Loop Rubocop: Fix some remaining cops Rubocop: Fix Style/BracesAroundHashParameters Extract a common DNSimple Rubocop config Rubocop: Fix Style/DotPosition Rubocop: Decreate recommended Metrics/MethodLength to 10 By default, run tests and linter. Rubocop: Add a couple of more cops Add Rubucop tasks Rubocop: Fix Style/BlockDelimiters Rubocop: Silence various metrics Rubocop: Silence Style/IfInsideElse Rubocop: Fix Style/HashSyntax Rubocop: Fix Style/EmptyLinesAroundBlockBody Rubocop: Fix Style/FormatString Rubocop: Fix Style/NumericLiterals Rubocop: Fix Style/MultilineMethodCallIndentation Rubocop: Fix Style/PercentLiteralDelimiters Rubocop: Silence Metrics/AbcSize ...
- Loading branch information
Showing
36 changed files
with
558 additions
and
345 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,13 @@ | ||
inherit_from: | ||
- .rubocop_todo.yml | ||
- .rubocop_dnsimple.yml | ||
|
||
# [codesmell] | ||
# It's irrelevant here, but it could be a code smell. | ||
# Hence keep it disabled, but don't include it in the DNSimple suite. | ||
Lint/Loop: | ||
Enabled: false | ||
|
||
# It doesn't seem to work as expected. | ||
Style/IfUnlessModifier: | ||
Enabled: false |
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,171 @@ | ||
AllCops: | ||
Exclude: | ||
# Exclude .gemspec files because they are generally auto-generated | ||
- '*.gemspec' | ||
|
||
# Generally, the keyword style uses a lot of space. This is particularly true when | ||
# you use case/if statements, in combination with a long-name variable. | ||
# | ||
# invoice_error_message = case error | ||
# when 1 == 1 | ||
# do_something | ||
# else | ||
# do_else | ||
# end | ||
# | ||
Lint/EndAlignment: | ||
AlignWith: variable | ||
|
||
# [codesmell] | ||
Metrics/AbcSize: | ||
Enabled: false | ||
Exclude: | ||
- 'spec/**/*_spec.rb' | ||
- 'test/**/*_test.rb' | ||
|
||
# [codesmell] | ||
Metrics/ClassLength: | ||
Enabled: false | ||
Exclude: | ||
- 'spec/**/*_spec.rb' | ||
- 'test/**/*_test.rb' | ||
|
||
# [codesmell] | ||
Metrics/MethodLength: | ||
Enabled: false | ||
Exclude: | ||
- 'spec/**/*_spec.rb' | ||
- 'test/**/*_test.rb' | ||
Max: 10 | ||
|
||
# [codesmell] | ||
Metrics/LineLength: | ||
Enabled: false | ||
Exclude: | ||
- 'spec/**/*_spec.rb' | ||
- 'test/**/*_test.rb' | ||
Max: 100 | ||
|
||
# [codesmell] | ||
# I don't really get the point of this cop. | ||
Performance/RedundantMerge: | ||
Enabled: false | ||
|
||
# Do not use "and" or "or" in conditionals, but for readability we can use it | ||
# to chain executions. Just beware of operator order. | ||
Style/AndOr: | ||
EnforcedStyle: conditionals | ||
|
||
# braces_for_chaining seems a good fit of what we've been doing so far. | ||
Style/BlockDelimiters: | ||
EnforcedStyle: braces_for_chaining | ||
IgnoredMethods: | ||
- expect | ||
|
||
# I'd rather use context_dependent, even if I'm not even sure we should enforce a style. | ||
Style/BracesAroundHashParameters: | ||
EnforcedStyle: context_dependent | ||
|
||
# I was a big fan of leading, but trailing seems to be more commonly adopted. | ||
# At least at the time being. | ||
Style/DotPosition: | ||
EnforcedStyle: trailing | ||
|
||
# Double empty lines are useful to separate conceptually different methods | ||
# in the same class or module. | ||
Style/EmptyLines: | ||
Enabled: false | ||
|
||
Style/EmptyLinesAroundBlockBody: | ||
Exclude: | ||
# RSpec is all made of blocks. Disable this config in RSpec | ||
# to be consistent with EmptyLinesAroundClassBody and EmptyLinesAroundModuleBody | ||
- 'spec/**/*_spec.rb' | ||
- 'test/**/*_test.rb' | ||
|
||
# In most cases, a space is nice. Sometimes, it's not. | ||
# Just be consistent with the rest of the surrounding code. | ||
Style/EmptyLinesAroundClassBody: | ||
Enabled: false | ||
|
||
# In most cases, a space is nice. Sometimes, it's not. | ||
# Just be consistent with the rest of the surrounding code. | ||
Style/EmptyLinesAroundModuleBody: | ||
Enabled: false | ||
|
||
# I personally don't care about the format style. | ||
# In most cases I like to use %, but not at the point I want to enforce it | ||
# as a convention in the entire code. | ||
Style/FormatString: | ||
Enabled: false | ||
|
||
# Prefer the latest Hash syntax | ||
Style/HashSyntax: | ||
Exclude: | ||
# But Rakefiles generally have some definition like | ||
# :default => :test | ||
# that looks nicer with the old rocket syntax. | ||
- 'Rakefile' | ||
|
||
# Array indentation should be considered like MultilineMethodCallIndentation indentation | ||
# and use 4 spaces instead of 2. | ||
Style/IndentArray: | ||
IndentationWidth: 4 | ||
|
||
# Hash indentation should be considered like MultilineMethodCallIndentation indentation | ||
# and use 4 spaces instead of 2. | ||
Style/IndentHash: | ||
IndentationWidth: 4 | ||
|
||
# [codesmell] | ||
# It's not always that bad. | ||
Style/IfInsideElse: | ||
Enabled: false | ||
|
||
# Multi-line differs from standard indentation, they are indented twice. | ||
Style/MultilineMethodCallIndentation: | ||
EnforcedStyle: indented | ||
IndentationWidth: 4 | ||
|
||
# unless is not always cool. | ||
Style/NegatedIf: | ||
Enabled: false | ||
|
||
# Magic numbers are not welcomed | ||
Style/NumericLiterals: | ||
Exclude: | ||
# however tests can use numeric literals for method calls, | ||
# without the need to define a variable just for that. | ||
- 'spec/**/*_spec.rb' | ||
- 'test/**/*_test.rb' | ||
|
||
# There are cases were the inline rescue is ok. We can either downgrade the severity, | ||
# or rely on the developer judgement on a case-by-case basis. | ||
Style/RescueModifier: | ||
Enabled: false | ||
|
||
# We don't have a preference. | ||
Style/SpecialGlobalVars: | ||
Enabled: false | ||
EnforcedStyle: use_perl_names | ||
|
||
# We generally use double quotes, sometimes single quotes. | ||
# Should we enforce it at code level? | ||
Style/StringLiterals: | ||
Enabled: false | ||
EnforcedStyle: double_quotes | ||
|
||
# It's nice to be consistent. The trailing comma also allows easy reordering, | ||
# and doesn't cause a diff in Git when you add a line to the bottom. | ||
Style/TrailingCommaInLiteral: | ||
EnforcedStyleForMultiline: consistent_comma | ||
|
||
Style/TrivialAccessors: | ||
# IgnoreClassMethods because I want to be able to define class-level accessors | ||
# that sets an instance variable on the metaclass, such as: | ||
# | ||
# def self.default=(value) | ||
# @default = value | ||
# end | ||
# | ||
IgnoreClassMethods: true |
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,14 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2016-03-27 01:01:12 +0100 using RuboCop version 0.38.0. | ||
# 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. | ||
|
||
Style/Documentation: | ||
# Silence this check for now until we fix it. | ||
Enabled: false | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'test/**/*' |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ gemspec | |
|
||
gem 'rake', '< 11' | ||
gem 'coveralls', require: false | ||
gem 'rubocop', require: false |
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
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
Oops, something went wrong.