From 59b74e6b6aeb169c8098fb410a8ef18209ab76a7 Mon Sep 17 00:00:00 2001 From: Montgomery Anderson Date: Fri, 15 Nov 2019 10:48:27 +1300 Subject: [PATCH 1/2] Removed the gitlab rules - defaulting it back to rubocops defaults --- rubocop_default.yml | 10 +-- rubocop_layout.yml | 106 -------------------------- rubocop_lint.yml | 182 -------------------------------------------- rubocop_metrics.yml | 48 ------------ rubocop_style.yml | 74 ------------------ 5 files changed, 3 insertions(+), 417 deletions(-) delete mode 100644 rubocop_layout.yml delete mode 100644 rubocop_lint.yml delete mode 100644 rubocop_metrics.yml delete mode 100644 rubocop_style.yml diff --git a/rubocop_default.yml b/rubocop_default.yml index a335fc7..6e14f3f 100644 --- a/rubocop_default.yml +++ b/rubocop_default.yml @@ -1,13 +1,9 @@ -require: +require: - rubocop-performance - rubocop-rspec -inherit_from: +inherit_from: - rubocop_all.yml - - rubocop_layout.yml - - rubocop_lint.yml - - rubocop_metrics.yml - rubocop_rails.yml - - rubocop_style.yml - rubocop_performance.yml - - rubocop_rspec.yml \ No newline at end of file + - rubocop_rspec.yml diff --git a/rubocop_layout.yml b/rubocop_layout.yml deleted file mode 100644 index 20c5749..0000000 --- a/rubocop_layout.yml +++ /dev/null @@ -1,106 +0,0 @@ -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Layout/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -Layout/EmptyLinesAroundBlockBody: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/IndentFirstArgument: - Enabled: true - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - EnforcedStyleForEmptyBraces: space - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Detect hard tabs, no hard tabs. -Layout/Tab: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingBlankLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: true - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: indented_internal_methods - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAfterSemicolon: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeComment: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true \ No newline at end of file diff --git a/rubocop_lint.yml b/rubocop_lint.yml deleted file mode 100644 index 29f7405..0000000 --- a/rubocop_lint.yml +++ /dev/null @@ -1,182 +0,0 @@ -# https://gitlab.com/gitlab-org/gitlab-styles/blob/master/rubocop-lint.yml - -# Checks for ambiguous block association with method when param passed without -# parentheses. -Lint/AmbiguousBlockAssociation: - Enabled: false - -# Checks for ambiguous operators in the first argument of a method invocation -# without parentheses. -Lint/AmbiguousOperator: - Enabled: true - -# This cop checks for ambiguous regexp literals in the first argument of -# a method invocation without parentheses. -Lint/AmbiguousRegexpLiteral: - Enabled: false - -# This cop checks for assignments in the conditions of -# if/while/until. -Lint/AssignmentInCondition: - Enabled: false - -# Default values in optional keyword arguments and optional ordinal arguments -# should not refer back to the name of the argument. -Lint/CircularArgumentReference: - Enabled: true - -# Check for debugger calls. -Lint/Debugger: - Enabled: true - -# Check for deprecated class method calls. -Lint/DeprecatedClassMethods: - Enabled: true - -# Check for immutable argument given to each_with_object. -Lint/EachWithObjectArgument: - Enabled: true - -# Check for odd code arrangement in an else block. -Lint/ElseLayout: - Enabled: true - -# Checks for empty ensure block. -Lint/EmptyEnsure: - Enabled: true - -# Checks for the presence of `when` branches without a body. -Lint/EmptyWhen: - Enabled: true - -# END blocks should not be placed inside method definitions. -Lint/EndInMethod: - Enabled: true - -# Do not use return in an ensure block. -Lint/EnsureReturn: - Enabled: true - -# Checks for flip flops. -Lint/FlipFlop: - Enabled: true - -# Catches floating-point literals too large or small for Ruby to represent. -Lint/FloatOutOfRange: - Enabled: true - -# The number of parameters to format/sprint must match the fields. -Lint/FormatParameterMismatch: - Enabled: true - -# This cop checks for *rescue* blocks with no body. -Lint/HandleExceptions: - Enabled: false - -# Checks for adjacent string literals on the same line, which could better be -# represented as a single string literal. -Lint/ImplicitStringConcatenation: - Enabled: true - -# Checks for attempts to use `private` or `protected` to set the visibility -# of a class method, which does not work. -Lint/IneffectiveAccessModifier: - Enabled: false - -# Checks of literals used in conditions. -Lint/LiteralAsCondition: - Enabled: true - -# Checks for literals used in interpolation. -Lint/LiteralInInterpolation: - Enabled: true - -# This cop checks for uses of *begin...end while/until something*. -Lint/Loop: - Enabled: false - -# Do not use nested method definitions. -Lint/NestedMethodDefinition: - Enabled: true - -# Do not omit the accumulator when calling `next` in a `reduce`/`inject` block. -Lint/NextWithoutAccumulator: - Enabled: true - -# Checks for method calls with a space before the opening parenthesis. -Lint/ParenthesesAsGroupedExpression: - Enabled: true - -# Checks for `rand(1)` calls. Such calls always return `0` and most likely -# a mistake. -Lint/RandOne: - Enabled: true - -# Use parentheses in the method call to avoid confusion about precedence. -Lint/RequireParentheses: - Enabled: true - -# Avoid rescuing the Exception class. -Lint/RescueException: - Enabled: true - -# Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception. -Lint/ShadowedException: - Enabled: false - -# This cop looks for use of the same name as outer local variables -# for block arguments or block local variables. -Lint/ShadowingOuterLocalVariable: - Enabled: false - -# Checks for Object#to_s usage in string interpolation. -Lint/StringConversionInInterpolation: - Enabled: true - -# Do not use prefix `_` for a variable that is used. -Lint/UnderscorePrefixedVariableName: - Enabled: true - -# This cop checks for using Fixnum or Bignum constant -Lint/UnifiedInteger: - Enabled: true - -# This cop checks for unneeded usages of splat expansion -Lint/RedundantSplatExpansion: - Enabled: false - -# Unreachable code. -Lint/UnreachableCode: - Enabled: true - -# This cop checks for unused block arguments. -Lint/UnusedBlockArgument: - Enabled: false - -# This cop checks for unused method arguments. -Lint/UnusedMethodArgument: - Enabled: false - -# Checks for useless access modifiers. -Lint/UselessAccessModifier: - Enabled: true - -# Checks for useless assignment to a local variable. -Lint/UselessAssignment: - Enabled: true - -# Checks for comparison of something with itself. -Lint/UselessComparison: - Enabled: true - -# Checks for useless `else` in `begin..end` without `rescue`. -Lint/UselessElseWithoutRescue: - Enabled: true - -# Checks for useless setter call to a local variable. -Lint/UselessSetterCall: - Enabled: true - -# Possible use of operator/literal/variable in void context. -Lint/Void: - Enabled: true diff --git a/rubocop_metrics.yml b/rubocop_metrics.yml deleted file mode 100644 index c839072..0000000 --- a/rubocop_metrics.yml +++ /dev/null @@ -1,48 +0,0 @@ -# https://gitlab.com/gitlab-org/gitlab-styles/blob/master/rubocop-metrics.yml - -# A calculated magnitude based on number of assignments, -# branches, and conditions. -Metrics/AbcSize: - Enabled: true - Max: 54.28 - -# This cop checks if the length of a block exceeds some maximum value. -Metrics/BlockLength: - Enabled: false - -# Avoid excessive block nesting. -Metrics/BlockNesting: - Enabled: true - Max: 4 - -# Avoid classes longer than 100 lines of code. -Metrics/ClassLength: - Enabled: false - -# A complexity metric that is strongly correlated to the number -# of test cases needed to validate a method. -Metrics/CyclomaticComplexity: - Enabled: true - Max: 13 - -# Limit lines to 80 characters. -Metrics/LineLength: - Enabled: false - -# Avoid methods longer than 10 lines of code. -Metrics/MethodLength: - Enabled: false - -# Avoid modules longer than 100 lines of code. -Metrics/ModuleLength: - Enabled: false - -# Avoid parameter lists longer than three or four parameters. -Metrics/ParameterLists: - Enabled: true - Max: 8 - -# A complexity metric geared towards measuring complexity for a human reader. -Metrics/PerceivedComplexity: - Enabled: true - Max: 14 \ No newline at end of file diff --git a/rubocop_style.yml b/rubocop_style.yml deleted file mode 100644 index 2fee196..0000000 --- a/rubocop_style.yml +++ /dev/null @@ -1,74 +0,0 @@ -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: true - EnforcedStyle: always - Exclude: - - 'actionview/test/**/*.builder' - - 'actionview/test/**/*.ruby' - - 'actionpack/test/**/*.builder' - - 'actionpack/test/**/*.ruby' - - 'activestorage/db/migrate/**/*.rb' - -Style/RedundantFreeze: - Enabled: true - Exclude: - - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' - -Style/ParenthesesAroundCondition: - Enabled: true - -Style/RedundantBegin: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true - -# Prefer Foo.method over Foo::method -Style/ColonMethodCall: - Enabled: true - -Style/TrivialAccessors: - Enabled: true - -Style/Documentation: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/RedundantPercentQ: - Enabled: true - -# Check quotes usage according to lint rule below. -Style/StringLiterals: - Enabled: true - EnforcedStyle: single_quotes - -Style/MixinUsage: - Exclude: - - bin/setup - - bin/update \ No newline at end of file From 8ebda2c6b3bd300a3a23d616eadb5fdc4e36dd02 Mon Sep 17 00:00:00 2001 From: Montgomery Anderson Date: Fri, 15 Nov 2019 10:51:42 +1300 Subject: [PATCH 2/2] Added in newlines to EOF for yml --- rubocop_all.yml | 2 +- rubocop_performance.yml | 2 +- rubocop_rails.yml | 2 +- rubocop_rspec.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rubocop_all.yml b/rubocop_all.yml index 71fdc3e..489aef1 100644 --- a/rubocop_all.yml +++ b/rubocop_all.yml @@ -7,4 +7,4 @@ AllCops: - 'actionpack/lib/action_dispatch/journey/parser.rb' - 'railties/test/fixtures/tmp/**/*' - 'node_modules/**/*' - - 'bin/**/*' \ No newline at end of file + - 'bin/**/*' diff --git a/rubocop_performance.yml b/rubocop_performance.yml index f57f568..bf49ede 100644 --- a/rubocop_performance.yml +++ b/rubocop_performance.yml @@ -21,4 +21,4 @@ Performance/ReverseEach: Enabled: true Performance/UnfreezeString: - Enabled: true \ No newline at end of file + Enabled: true diff --git a/rubocop_rails.yml b/rubocop_rails.yml index 1af2354..22a8bb6 100644 --- a/rubocop_rails.yml +++ b/rubocop_rails.yml @@ -1,2 +1,2 @@ Rails: - Enabled: true \ No newline at end of file + Enabled: true diff --git a/rubocop_rspec.yml b/rubocop_rspec.yml index 0a9ea88..211bc92 100644 --- a/rubocop_rspec.yml +++ b/rubocop_rspec.yml @@ -18,4 +18,4 @@ RSpec/MessageSpies: SupportedStyles: - have_received - receive - StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies \ No newline at end of file + StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies