Merge pull request #15587 from CartoDB/fix-rubocop

Add GitHub action for Rubocop
pull/15663/head
Alberto Romeu 4 years ago committed by GitHub
commit 6bb5c73157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,16 @@
# https://github.com/reviewdog/action-rubocop
name: Rubocop
on: [pull_request]
jobs:
rubocop:
name: check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Rubocop linter
uses: reviewdog/action-rubocop@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review # Optional. Default: github-pr-check
level: error # Optional. Default: error

@ -3,8 +3,9 @@ scss:
jshint: jshint:
enabled: false enabled: false
rubocop: rubocop:
enabled: false
config_file: .rubocop.yml config_file: .rubocop.yml
version: 0.71.0 version: 0.80.0
eslint: eslint:
enabled: true enabled: true
config_file: .eslintrc.json config_file: .eslintrc.json

@ -43,13 +43,13 @@ Layout/AccessModifierIndentation:
Enabled: true Enabled: true
EnforcedStyle: indent EnforcedStyle: indent
Layout/AlignHash: Layout/HashAlignment:
Enabled: true Enabled: true
EnforcedHashRocketStyle: key EnforcedHashRocketStyle: key
EnforcedColonStyle: key EnforcedColonStyle: key
EnforcedLastArgumentHashStyle: always_inspect EnforcedLastArgumentHashStyle: always_inspect
Layout/AlignParameters: Layout/ParameterAlignment:
Enabled: true Enabled: true
EnforcedStyle: with_first_parameter EnforcedStyle: with_first_parameter
@ -69,7 +69,7 @@ Layout/EmptyLinesAroundModuleBody:
Layout/ExtraSpacing: Layout/ExtraSpacing:
Enabled: true Enabled: true
Layout/IndentFirstArgument: Layout/FirstArgumentIndentation:
Enabled: true Enabled: true
EnforcedStyle: special_for_inner_method_call_in_parentheses EnforcedStyle: special_for_inner_method_call_in_parentheses
@ -77,7 +77,7 @@ Layout/IndentationWidth:
Enabled: true Enabled: true
Width: 2 Width: 2
Layout/IndentFirstHashElement: Layout/FirstHashElementIndentation:
Description: Checks the indentation of the first key in a hash literal. Description: Checks the indentation of the first key in a hash literal.
Enabled: true Enabled: true
EnforcedStyle: special_inside_parentheses EnforcedStyle: special_inside_parentheses
@ -112,11 +112,11 @@ Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space EnforcedStyleForEmptyBraces: no_space
Layout/TrailingBlankLines: Layout/TrailingEmptyLines:
Enabled: true Enabled: true
EnforcedStyle: final_newline EnforcedStyle: final_newline
Layout/AlignArray: Layout/ArrayAlignment:
Enabled: true Enabled: true
Layout/BlockEndNewline: Layout/BlockEndNewline:
@ -143,7 +143,7 @@ Layout/EndOfLine:
Layout/IndentationConsistency: Layout/IndentationConsistency:
Enabled: true Enabled: true
Layout/IndentFirstArrayElement: Layout/FirstArrayElementIndentation:
Enabled: true Enabled: true
Layout/LeadingCommentSpace: Layout/LeadingCommentSpace:
@ -185,9 +185,6 @@ Layout/SpaceBeforeSemicolon:
Layout/SpaceAroundOperators: Layout/SpaceAroundOperators:
Enabled: true Enabled: true
Layout/SpaceInsideBrackets:
Enabled: true
Layout/SpaceInsideParens: Layout/SpaceInsideParens:
Enabled: true Enabled: true
@ -200,9 +197,6 @@ Layout/Tab:
Layout/TrailingWhitespace: Layout/TrailingWhitespace:
Enabled: true Enabled: true
Layout/SpaceBeforeFirstArg:
Enabled: true
# #
@ -217,10 +211,6 @@ Style/BarePercentLiterals:
Enabled: true Enabled: true
EnforcedStyle: bare_percent EnforcedStyle: bare_percent
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: no_braces
Style/ClassCheck: Style/ClassCheck:
Enabled: true Enabled: true
EnforcedStyle: is_a? EnforcedStyle: is_a?
@ -362,15 +352,23 @@ Style/StructInheritance:
Style/UnlessElse: Style/UnlessElse:
Enabled: true Enabled: true
Style/UnneededCapitalW: Style/RedundantCapitalW:
Enabled: true Enabled: true
Style/UnneededPercentQ: Style/RedundantPercentQ:
Enabled: true Enabled: true
Style/WhileUntilDo: Style/WhileUntilDo:
Enabled: true Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
# #
@ -381,7 +379,7 @@ Metrics/AbcSize:
Enabled: true Enabled: true
Max: 35 Max: 35
Metrics/LineLength: Layout/LineLength:
Enabled: true Enabled: true
Max: 120 Max: 120
AllowURI: true AllowURI: true
@ -413,7 +411,7 @@ Lint/RescueException:
Lint/ShadowingOuterLocalVariable: Lint/ShadowingOuterLocalVariable:
Enabled: true Enabled: true
Lint/StringConversionInInterpolation: Lint/RedundantStringCoercion:
Enabled: true Enabled: true
Lint/UnusedBlockArgument: Lint/UnusedBlockArgument:
@ -455,47 +453,14 @@ Lint/EmptyEnsure:
Lint/EmptyInterpolation: Lint/EmptyInterpolation:
Enabled: true Enabled: true
Lint/EndInMethod:
Enabled: true
Lint/EnsureReturn: Lint/EnsureReturn:
Enabled: true Enabled: true
Lint/RaiseException:
#
# Rails cops
#
Rails/HasAndBelongsToMany:
Enabled: true Enabled: true
Include:
- app/models/**/*.rb
Rails/Output: Lint/StructNewOverride:
Enabled: true Enabled: true
Include:
- app/**/*.rb
- config/**/*.rb
- db/**/*.rb
- lib/**/*.rb
Rails/ReadWriteAttribute:
Enabled: true
Include:
- app/models/**/*.rb
Rails/ScopeArgs:
Enabled: true
Include:
- app/models/**/*.rb
Rails/Validation:
Enabled: true
Include:
- app/models/**/*.rb
# #
@ -598,7 +563,7 @@ Style/EmptyLiteral:
Enabled: false Enabled: false
Style/EvenOdd: Style/EvenOdd:
Enabled: false Enabled: false
Style/FlipFlop: Lint/FlipFlop:
Enabled: false Enabled: false
Style/IfWithSemicolon: Style/IfWithSemicolon:
Enabled: false Enabled: false
@ -660,9 +625,7 @@ Lint/DeprecatedClassMethods:
Enabled: false Enabled: false
Lint/ElseLayout: Lint/ElseLayout:
Enabled: false Enabled: false
Lint/HandleExceptions: Lint/SuppressedException:
Enabled: false
Lint/LiteralInCondition:
Enabled: false Enabled: false
Lint/LiteralInInterpolation: Lint/LiteralInInterpolation:
Enabled: false Enabled: false
@ -676,7 +639,3 @@ Lint/UnderscorePrefixedVariableName:
Enabled: false Enabled: false
Lint/Void: Lint/Void:
Enabled: false Enabled: false
Rails/ActionFilter:
Enabled: false
Rails/Delegate:
Enabled: false

@ -1,4 +1,4 @@
# rubocop:disable Metrics/LineLength, Style/ExtraSpacing, Style/SingleSpaceBeforeFirstArg # rubocop:disable Layout/LineLength, Layout/ExtraSpacing, Layout/SpaceBeforeFirstArg
# NOTES: # NOTES:
# (/u/:user_domain) -> This allows support of org-urls (support != enforcement) # (/u/:user_domain) -> This allows support of org-urls (support != enforcement)
@ -760,4 +760,4 @@ CartoDB::Application.routes.draw do
end end
end end
# rubocop:enable Metrics/LineLength, Style/ExtraSpacing, Style/SingleSpaceBeforeFirstArg # rubocop:enable Layout/LineLength, Layout/ExtraSpacing, Layout/SpaceBeforeFirstArg

Loading…
Cancel
Save