diff --git a/.hound.yml b/.hound.yml index 39e28b3ac2..612bc4ab7b 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,5 +1,5 @@ ruby: - config_file: .ruby-style.yml + config_file: .rubocop.yml scss: enabled: true config_file: .scss-lint.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000000..8f1fba4782 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,363 @@ +AllCops: + Exclude: + - spec/example_app/db/schema.rb + +AccessorMethodName: + Enabled: false + +ActionFilter: + Enabled: false + +Alias: + Enabled: false + +ArrayJoin: + Enabled: false + +AsciiComments: + Enabled: false + +AsciiIdentifiers: + Enabled: false + +Attr: + Enabled: false + +BlockNesting: + Enabled: false + +CaseEquality: + Enabled: false + +CharacterLiteral: + Enabled: false + +ClassAndModuleChildren: + Enabled: true + EnforcedStyle: nested + +ClassLength: + Enabled: false + +ModuleLength: + Enabled: false + +ClassVars: + Enabled: false + +CollectionMethods: + Enabled: true + PreferredMethods: + find: detect + inject: reduce + collect: map + find_all: select + +ColonMethodCall: + Enabled: false + +CommentAnnotation: + Enabled: false + +CyclomaticComplexity: + Enabled: false + +Delegate: + Enabled: false + +DeprecatedHashMethods: + Enabled: false + +Documentation: + Enabled: false + +DotPosition: + EnforcedStyle: trailing + +DoubleNegation: + Enabled: false + +EachWithObject: + Enabled: false + +EmptyLiteral: + Enabled: false + +Encoding: + Enabled: false + +EvenOdd: + Enabled: false + +ExtraSpacing: + Enabled: true + +FileName: + Enabled: false + +FlipFlop: + Enabled: false + +FormatString: + Enabled: false + +GlobalVars: + Enabled: false + +GuardClause: + Enabled: false + +IfUnlessModifier: + Enabled: false + +IfWithSemicolon: + Enabled: false + +InlineComment: + Enabled: false + +Lambda: + Enabled: false + +LambdaCall: + Enabled: false + +LineEndConcatenation: + Enabled: false + +LineLength: + Max: 80 + +MethodLength: + Enabled: false + +ModuleFunction: + Enabled: false + +MultilineOperationIndentation: + Enabled: true + EnforcedStyle: indented + +NegatedIf: + Enabled: false + +NegatedWhile: + Enabled: false + +Next: + Enabled: false + +NilComparison: + Enabled: false + +Not: + Enabled: false + +NumericLiterals: + Enabled: false + +OneLineConditional: + Enabled: false + +OpMethod: + Enabled: false + +ParameterLists: + Enabled: false + +PercentLiteralDelimiters: + Enabled: false + +PerlBackrefs: + Enabled: false + +PredicateName: + NamePrefixBlacklist: + - is_ + Exclude: + - spec/**/* + +Proc: + Enabled: false + +RaiseArgs: + Enabled: false + +RegexpLiteral: + Enabled: false + +SelfAssignment: + Enabled: false + +SingleLineBlockParams: + Enabled: false + +SingleLineMethods: + Enabled: false + +SignalException: + Enabled: false + +SpecialGlobalVars: + Enabled: false + +StringLiterals: + EnforcedStyle: double_quotes + +TrailingComma: + EnforcedStyleForMultiline: comma + SupportedStyles: + - comma + - no_comma + +TrivialAccessors: + Enabled: false + +VariableInterpolation: + Enabled: false + +WhenThen: + Enabled: false + +WhileUntilModifier: + Enabled: false + +WordArray: + Enabled: false + +# Lint + +AmbiguousOperator: + Enabled: false + +AmbiguousRegexpLiteral: + Enabled: false + +AssignmentInCondition: + Enabled: false + +CircularArgumentReference: + Enabled: false + +ConditionPosition: + Enabled: false + +DeprecatedClassMethods: + Enabled: false + +DuplicatedKey: + Enabled: false + +EachWithObjectArgument: + Enabled: false + +ElseLayout: + Enabled: false + +FormatParameterMismatch: + Enabled: false + +HandleExceptions: + Enabled: false + +InvalidCharacterLiteral: + Enabled: false + +InitialIndentation: + Enabled: false + +LiteralInCondition: + Enabled: false + +LiteralInInterpolation: + Enabled: false + +Loop: + Enabled: false + +NestedMethodDefinition: + Enabled: false + +NonLocalExitFromIterator: + Enabled: false + +ParenthesesAsGroupedExpression: + Enabled: false + +RequireParentheses: + Enabled: false + +UnderscorePrefixedVariableName: + Enabled: false + +UnneededDisable: + Enabled: false + +Void: + Enabled: false + +# Performance + +CaseWhenSplat: + Enabled: false + +Count: + Enabled: false + +Detect: + Enabled: false + +FlatMap: + Enabled: false + +ReverseEach: + Enabled: false + +Sample: + Enabled: false + +Size: + Enabled: false + +StringReplacement: + Enabled: false + +# Rails + +ActionFilter: + Enabled: false + +Date: + Enabled: false + +DefaultScope: + Enabled: false + +FindBy: + Enabled: false + +FindEach: + Enabled: false + +HasAndBelongsToMany: + Enabled: false + +Output: + Enabled: false + +ReadWriteAttribute: + Enabled: false + +ScopeArgs: + Enabled: false + +TimeZone: + Enabled: false + +Validation: + Enabled: false + +Style/MultilineBlockChain: + Description: 'Avoid multi-line chains of blocks.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' + Enabled: false diff --git a/.ruby-style.yml b/.ruby-style.yml deleted file mode 100644 index d5679a847f..0000000000 --- a/.ruby-style.yml +++ /dev/null @@ -1,3 +0,0 @@ -AllCops: - Exclude: - - "spec/example_app/db/schema.rb" diff --git a/Gemfile.lock b/Gemfile.lock index 8966da27ad..c802084e87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,36 +16,36 @@ PATH GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.2) - actionpack (= 4.2.2) - actionview (= 4.2.2) - activejob (= 4.2.2) + actionmailer (4.2.5.1) + actionpack (= 4.2.5.1) + actionview (= 4.2.5.1) + activejob (= 4.2.5.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.2) - actionview (= 4.2.2) - activesupport (= 4.2.2) + actionpack (4.2.5.1) + actionview (= 4.2.5.1) + activesupport (= 4.2.5.1) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - actionview (4.2.2) - activesupport (= 4.2.2) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.5.1) + activesupport (= 4.2.5.1) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - activejob (4.2.2) - activesupport (= 4.2.2) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.5.1) + activesupport (= 4.2.5.1) globalid (>= 0.3.0) - activemodel (4.2.2) - activesupport (= 4.2.2) + activemodel (4.2.5.1) + activesupport (= 4.2.5.1) builder (~> 3.1) - activerecord (4.2.2) - activemodel (= 4.2.2) - activesupport (= 4.2.2) + activerecord (4.2.5.1) + activemodel (= 4.2.5.1) + activesupport (= 4.2.5.1) arel (~> 6.0) - activesupport (4.2.2) + activesupport (4.2.5.1) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -83,6 +83,7 @@ GEM xpath (~> 2.0) cliver (0.3.2) coderay (1.1.0) + concurrent-ruby (1.0.0) crack (0.4.2) safe_yaml (~> 1.0.0) database_cleaner (1.5.1) @@ -155,9 +156,9 @@ GEM rails rdiscount (>= 1.6.8, < 2.0) method_source (0.8.2) - mime-types (2.6.2) + mime-types (2.99) mini_portile2 (2.0.0) - minitest (5.8.1) + minitest (5.8.4) momentjs-rails (2.11.0) railties (>= 3.1) multi_json (1.11.2) @@ -189,16 +190,16 @@ GEM rack-test (0.6.3) rack (>= 1.0) rack-timeout (0.3.2) - rails (4.2.2) - actionmailer (= 4.2.2) - actionpack (= 4.2.2) - actionview (= 4.2.2) - activejob (= 4.2.2) - activemodel (= 4.2.2) - activerecord (= 4.2.2) - activesupport (= 4.2.2) + rails (4.2.5.1) + actionmailer (= 4.2.5.1) + actionpack (= 4.2.5.1) + actionview (= 4.2.5.1) + activejob (= 4.2.5.1) + activemodel (= 4.2.5.1) + activerecord (= 4.2.5.1) + activesupport (= 4.2.5.1) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.2) + railties (= 4.2.5.1) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) @@ -206,16 +207,16 @@ GEM activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.2) + rails-html-sanitizer (1.0.3) loofah (~> 2.0) rails_stdout_logging (0.0.4) - railties (4.2.2) - actionpack (= 4.2.2) - activesupport (= 4.2.2) + railties (4.2.5.1) + actionpack (= 4.2.5.1) + activesupport (= 4.2.5.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.15.0) - rake (10.4.2) + rake (10.5.0) rdiscount (1.6.8) redcarpet (3.3.3) rspec (3.1.0) @@ -251,12 +252,13 @@ GEM shoulda-matchers (2.8.0) activesupport (>= 3.0.0) slop (3.6.0) - sprockets (3.4.0) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) + sprockets-rails (3.0.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) term-ansicolor (1.3.2) tins (~> 1.0) terminal-table (1.5.2)