This repository contains some linter configurations for the linter tools used in Uqido.
-
Our Rubocop rules needs rubocop-performance and rubocop-rails gems: add these to your
Gemfile
:group :development do gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end
-
In your project's root create a new file named
.rubocop.yml
-
Add to
.rubocop.yml
theinherit_from
rule like this to inherit from the main rubocop configuration:inherit_from: - https://raw.githubusercontent.com/Uqido/uqido-linters-config/master/.rubocop.yml
-
If you use another Rubocop version (eg. 0.80), you have to specify another rule set
inherit_from: - https://raw.githubusercontent.com/Uqido/uqido-linters-config/master/.rubocop.0.80.yml
-
Then, add below the
inherit_from
rule your custom rule set.
inherit_from:
- https://raw.githubusercontent.com/Uqido/uqido-linters-config/master/.rubocop.yml
AllCops:
TargetRubyVersion: '2.6.6'
Include:
- Gemfile
- Rakefile
- config.ru
- lib/**/*.rake
- spec/**/*
Exclude:
- db/schema.rb
- db/migrate/*.*
- Capfile
- tmp/**/*.*
- spec/**/*.csv
- spec/**/*.json
- spec/**/*.xlsx
- spec/**/*.js
# Your rules below ..
Layout/LineLength:
Enabled: true
Max: 160
Metrics/BlockLength:
ExcludedMethods: ['describe', 'context']