mirror of
https://github.com/dev-sec/linux-baseline
synced 2024-11-22 03:03:02 +00:00
use cookstyle for linting
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
This commit is contained in:
parent
f0084b869f
commit
b06edb2adc
3 changed files with 6 additions and 28 deletions
28
.rubocop.yml
28
.rubocop.yml
|
@ -2,31 +2,3 @@
|
||||||
AllCops:
|
AllCops:
|
||||||
Exclude:
|
Exclude:
|
||||||
- vendor/**/*
|
- vendor/**/*
|
||||||
Documentation:
|
|
||||||
Enabled: false
|
|
||||||
ParameterAlignment:
|
|
||||||
Enabled: true
|
|
||||||
HashSyntax:
|
|
||||||
Enabled: true
|
|
||||||
LineLength:
|
|
||||||
Enabled: false
|
|
||||||
EmptyLinesAroundBlockBody:
|
|
||||||
Enabled: false
|
|
||||||
Style/IfUnlessModifier:
|
|
||||||
Enabled: false
|
|
||||||
MethodLength:
|
|
||||||
Max: 40
|
|
||||||
NumericLiterals:
|
|
||||||
MinDigits: 10
|
|
||||||
Metrics/BlockLength:
|
|
||||||
Max: 35
|
|
||||||
Metrics/CyclomaticComplexity:
|
|
||||||
Max: 10
|
|
||||||
Metrics/PerceivedComplexity:
|
|
||||||
Max: 10
|
|
||||||
Metrics/AbcSize:
|
|
||||||
Max: 30
|
|
||||||
# Lint/AmbiguousBlockAssociation is incompatible with RSpec
|
|
||||||
# https://github.com/rubocop-hq/rubocop/issues/4222
|
|
||||||
Lint/AmbiguousBlockAssociation:
|
|
||||||
Enabled: false
|
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gem 'cookstyle'
|
||||||
gem 'highline'
|
gem 'highline'
|
||||||
gem 'rack'
|
gem 'rack'
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
|
|
5
Rakefile
5
Rakefile
|
@ -1,5 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'cookstyle'
|
||||||
require 'rake/testtask'
|
require 'rake/testtask'
|
||||||
require 'rubocop/rake_task'
|
require 'rubocop/rake_task'
|
||||||
|
|
||||||
|
@ -9,6 +10,10 @@ task :rubocop do
|
||||||
RuboCop::RakeTask.new
|
RuboCop::RakeTask.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RuboCop::RakeTask.new(:cookstyle) do |task|
|
||||||
|
task.options << '--display-cop-names'
|
||||||
|
end
|
||||||
|
|
||||||
# lint the project
|
# lint the project
|
||||||
desc 'Run robocop linter'
|
desc 'Run robocop linter'
|
||||||
task lint: [:rubocop]
|
task lint: [:rubocop]
|
||||||
|
|
Loading…
Reference in a new issue