Skip to content

Commit

Permalink
Make Rubocop happy
Browse files Browse the repository at this point in the history
By exluding some rules for the not yet refactored (just moved too lib)
kdump client.
  • Loading branch information
dgdavid committed Sep 7, 2021
1 parent 42001cb commit b4df3ba
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
23 changes: 22 additions & 1 deletion .rubocop.yml
Expand Up @@ -11,6 +11,8 @@ Metrics/AbcSize:
Max: 30
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

Metrics/BlockNesting:
Max: 5
Expand All @@ -21,7 +23,8 @@ Metrics/BlockNesting:
Max: 2
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib

Exclude:
- 'src/lib/kdump/clients/kdump.rb'

# Configuration parameters: CountComments.
Metrics/ClassLength:
Expand All @@ -34,6 +37,8 @@ Metrics/ClassLength:
Max: 200
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

Metrics/ModuleLength:
Max: 385
Expand All @@ -44,6 +49,8 @@ Metrics/ModuleLength:
Max: 100
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

Metrics/CyclomaticComplexity:
Max: 29
Expand All @@ -54,6 +61,8 @@ Metrics/CyclomaticComplexity:
Max: 10
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Expand All @@ -66,6 +75,8 @@ Metrics/LineLength:
Max: 100 # TODO this should be lower for new code
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

# Configuration parameters: CountComments.
Metrics/MethodLength:
Expand All @@ -78,6 +89,8 @@ Metrics/MethodLength:
Max: 30 # TODO this should be lower for new code
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

Metrics/PerceivedComplexity:
Max: 34
Expand All @@ -88,6 +101,8 @@ Metrics/PerceivedComplexity:
Max: 10
Include:
- 'src/lib/**/*.rb' # be more strict for new code in lib
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

# be more strict then rubocop, 5 is too much
Metrics/ParameterLists:
Expand All @@ -100,6 +115,8 @@ Style/AndOr:
Style/Documentation:
Include:
- 'src/lib/**/*.rb' # force well documented code only for new code
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

Style/FileName:
Include:
Expand All @@ -108,6 +125,8 @@ Style/FileName:
Style/HashSyntax:
Include:
- 'src/lib/**/*.rb' # force new hash style only for new code
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

# JR: I found lambda easier to read and understand then ->()
Style/Lambda:
Expand All @@ -116,6 +135,8 @@ Style/Lambda:
Style/MethodName:
Include:
- 'src/lib/**/*.rb' # force correct names on new code
Exclude:
- 'src/lib/kdump/clients/kdump.rb'

Style/VariableName:
Include:
Expand Down
17 changes: 10 additions & 7 deletions test/lib/kdump/clients/kdump_test.rb
Expand Up @@ -4,15 +4,18 @@
Yast.import "CommandLine"
Yast.import "Kdump"

# Let's "dirty-mock" Yast::KdumpComplexInclude to avoid not desired dialogs during test
# FIXME: we should find the way to get rid of this "dirty-mock", which is here
# to avoid triggering some dialogs from Yast::KdumpComplexInclude routines during tests.
require_relative "../../../../src/include/kdump/complex"
module Yast::KdumpComplexInclude
def ReadDialog
true
end
module Yast
module KdumpComplexInclude
def ReadDialog
true
end

def InstallPackages
true
def InstallPackages
true
end
end
end

Expand Down

0 comments on commit b4df3ba

Please sign in to comment.