forked from cucumber/cucumber-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
158 lines (131 loc) · 4.39 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
inherit_from: .rubocop_todo.yml
require:
- rubocop-packaging
AllCops:
NewCops: disable
# Keep this inline with the lowest ruby-* version in circleci/config.yml and
# the version in the gemspec
TargetRubyVersion: 2.5
# Cop names are not displayed in offense messages by default. Change behavior
# by overriding DisplayCopNames, or by giving the `-D/--display-cop-names`
# option.
DisplayCopNames: true
# Style guide URLs are not displayed in offense messages by default. Change
# behavior by overriding `DisplayStyleGuide`, or by giving the
# `-S/--display-style-guide` option.
DisplayStyleGuide: true
Exclude:
- 'bin/*'
- 'tmp/**/*'
- 'vendor/**/*'
- 'temp_app/**/*'
- 'cck/features/**/*'
# Reviewed: we need to specify 'cucumber-core' and 'cucumber-wire' twice
# to be able to build using git on CI, but also using local repos locally.
Bundler/DuplicatedGem:
Exclude:
- 'Gemfile'
- 'cck/Gemfile'
# Disabling for appveyor
Layout/EndOfLine:
Enabled: false
# Disabling this cop until the minimum Ruby version is >= 2.3 as squiggly
# heredocs '<<~' were introduced then. The files below are the current ones
# with offenses
Layout/HeredocIndentation:
Exclude:
- 'features/lib/support/feature_factory.rb'
- 'lib/cucumber/cli/options.rb'
- 'lib/cucumber/cli/profile_loader.rb'
- 'spec/cucumber/cli/configuration_spec.rb'
- 'spec/cucumber/cli/profile_loader_spec.rb'
- 'spec/cucumber/formatter/pretty_spec.rb'
# Reviewed: Formatters put trailing spaces after things like 'Feature: '
# In pretty_spec.rb, progress_spec.rb offences look false,
# as the trailing spaces are in multiline string literals
Layout/TrailingWhitespace:
Exclude:
- 'spec/cucumber/formatter/pretty_spec.rb'
- 'spec/cucumber/formatter/progress_spec.rb'
# Reviewed: please see PR-1022 for details on why this cop is disabled:
# https://github.com/cucumber/cucumber-ruby/pull/1022
Lint/AmbiguousOperator:
Enabled: false
Metrics/AbcSize:
Max: 45
Metrics/BlockLength:
CountComments: false
Exclude:
- './cucumber.gemspec'
- './spec/**/*'
- 'cck/spec/**/*'
Metrics/ClassLength:
Max: 375
Exclude:
- 'lib/cucumber/cli/options.rb'
Metrics/CyclomaticComplexity:
Max: 12
# A line length of 200 covers most violations in the repo while still being
# a more up to date length given today's screen sizes
Layout/LineLength:
Max: 200
Metrics/ModuleLength:
Max: 150
Exclude:
- './spec/**/*'
- 'cck/spec/**/*'
Metrics/MethodLength:
Max: 30
Metrics/PerceivedComplexity:
Max: 13
# Rubocop doesn't like method names in other languages but as Cucumber supports
# languages, this cop needs to be disabled.
Naming/AsciiIdentifiers:
Enabled: false
# For the most part, the project is solid on naming. There are though, a few
# cases where the cop doesn't need to catch.
Naming/MethodName:
EnforcedStyle: snake_case
Enabled: true
Exclude:
- 'examples/i18n/ar/lib/calculator.rb'
- 'examples/i18n/he/lib/calculator.rb'
- 'examples/i18n/he/lib/calculator.rb'
- 'examples/i18n/tr/lib/hesap_makinesi.rb'
- 'lib/cucumber/glue/dsl.rb'
# In most cases, being descriptive with parameter names helps a reader understand
# what the variable is for. In some cases, shorter names are sufficient.
Naming/MethodParameterName:
AllowedNames: _, e, n, v, id, io, gh, pr
# Reviewed: these offenses look false as the variables are in cyrillic
Naming/VariableName:
Exclude:
- 'examples/i18n/ru/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/uk/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/uz/features/step_definitions/calculator_steps.rb'
# Rubocop doesn't handle some international words well for this cop
Naming/VariableNumber:
EnforcedStyle: normalcase
Exclude:
- 'examples/i18n/**/*'
# This cop throws errors when parsing a lot of the repo's code, possibly due
# to splat issues?
Style/AccessModifierDeclarations:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/Documentation:
Enabled: false
Style/FormatStringToken:
EnforcedStyle: annotated
Style/FloatDivision:
Enabled: false
Style/StderrPuts:
Enabled: false
# Slashes are by far the most used form of regex values in the project.
# Rubocop doesn't handle all cases well (currently), so this cop has been
# disabled in some cases.
Style/RegexpLiteral:
EnforcedStyle: slashes
Exclude:
- 'spec/cucumber/project_initializer_spec.rb'