Commit 9e1e8da5 authored by Álax Alves's avatar Álax Alves

Adding rubocop linter tool

parent e7f2adea
......@@ -105,16 +105,23 @@ cypress:
script: bundle exec rake cypress:run
stage: all-tests
code_quality:
rubocop:
<<: *retriable
script:
- rubocop
stage: all-tests
code_quality:
<<: *retriable
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
before_script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
script:
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
......@@ -122,3 +129,4 @@ code_quality:
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [gl-code-quality-report.json]
stage: all-tests
AllCops:
TargetRubyVersion: 2.5.1
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Exclude:
- '**/templates/**/*'
- '**/vendor/**/*'
- '**/vendor/**/.*'
- '**/node_modules/**/*'
- 'actionpack/lib/action_dispatch/journey/parser.rb'
# 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
# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
# Align comments with method definitions.
Layout/CommentIndentation:
Enabled: true
Layout/EmptyLineAfterMagicComment:
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/FirstParameterIndentation:
Enabled: true
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Style/HashSyntax:
Enabled: true
# Method definitions after `private` or `protected` isolated calls need one
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: rails
# Two spaces, no tabs (for indentation).
Layout/IndentationWidth:
Enabled: true
Layout/SpaceAfterColon:
Enabled: true
Layout/SpaceAfterComma:
Enabled: true
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
Layout/SpaceAroundKeyword:
Enabled: true
Layout/SpaceAroundOperators:
Enabled: true
Layout/SpaceBeforeFirstArg:
Enabled: true
# Defining a method with parameters needs parentheses.
Style/MethodDefParentheses:
Enabled: true
# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Enabled: true
# Use `foo { bar }` not `foo {bar}`.
Layout/SpaceInsideBlockBraces:
Enabled: true
# Use `{ a: 1 }` not `{a:1}`.
Layout/SpaceInsideHashLiteralBraces:
Enabled: true
Layout/SpaceInsideParens:
Enabled: true
# Check quotes usage according to lint rule below.
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
# 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
# Use quotes for string literals when they are enough.
Style/UnneededPercentQ:
Enabled: true
# Align `end` with the matching keyword or starting expression except for
# assignments, where it should be aligned with the LHS.
Layout:
Enabled: true
EnforcedStyleAlignWith: variable
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
Lint/RequireParentheses:
Enabled: true
......@@ -81,6 +81,7 @@ end
group :development, :test do
gem 'spring'
gem 'rubocop', require: false
end
group :test do
......
......@@ -138,6 +138,7 @@ GEM
ansi (1.4.3)
api-pagination (4.2.0)
arel (6.0.3)
ast (2.4.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
......@@ -226,6 +227,7 @@ GEM
domain_name (~> 0.5)
i18n (0.7.0)
ice_nine (0.11.1)
jaro_winkler (1.5.1)
json (1.8.2)
kgio (2.9.2)
launchy (2.4.3)
......@@ -257,9 +259,13 @@ GEM
netrc (0.11.0)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
pg (0.17.1)
pothoven-attachment_fu (3.2.16)
power_assert (1.1.1)
powerpack (0.1.2)
protected_attributes (1.1.3)
activemodel (>= 4.0.1, < 5.0)
public_suffix (3.0.2)
......@@ -301,6 +307,7 @@ GEM
activesupport (= 4.2.5.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
raindrops (0.13.0)
rake (10.3.2)
rb-fsevent (0.10.3)
......@@ -309,8 +316,8 @@ GEM
recaptcha (4.3.1)
json
rest-client (2.0.2)
http-cookie (< 2.0, >= 1.0.2)
mime-types (< 4.0, >= 1.16)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rmagick (2.16.0)
rpush (2.7.0)
......@@ -341,9 +348,17 @@ GEM
rspec-mocks (~> 3.3.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
rubocop (0.57.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-feedparser (0.9.3)
magic
ruby-progressbar (1.4.2)
ruby-progressbar (1.7.5)
rubyzip (1.2.1)
sass (3.5.5)
sass-listen (~> 4.0.0)
......@@ -351,11 +366,11 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (< 6, >= 4.0.0)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets-rails (< 4.0, >= 2.0)
sprockets (< 4.0, >= 2.8)
tilt (< 3, >= 1.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
scenic (1.4.1)
activerecord (>= 4.0.0)
childprocess (~> 0.5)
......@@ -401,6 +416,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.0)
unicorn (4.8.3)
kgio (~> 2.6)
rack
......@@ -487,7 +503,9 @@ DEPENDENCIES
rpush
rspec
rspec-rails
rubocop (~> 0.57.2)
ruby-feedparser
ruby-progressbar (~> 1.7.0)
ruby_bosh (> 0.0.0)!
rubyzip
sass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment