forked from cucumber/cucumber-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
111 lines (94 loc) · 3.46 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
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude
require:
- rubocop-capybara
- rubocop-packaging
- rubocop-rake
- rubocop-rspec
AllCops:
NewCops: disable
# Keep this inline with the lowest ruby version in the gemspec
TargetRubyVersion: 2.7
# Display cop name / style guide references
DisplayCopNames: true
DisplayStyleGuide: true
Exclude:
- 'bin/*'
- 'tmp/**/*'
- 'vendor/**/*'
- 'temp_app/**/*'
- 'cck/features/**/*'
# 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
# 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 fact multiline string literals
Layout/TrailingWhitespace:
Exclude:
- 'spec/cucumber/formatter/pretty_spec.rb'
- 'spec/cucumber/formatter/progress_spec.rb'
# TODO: [LH] - This needs a re-review. I think we can pretty much delete / phase this out with incremental updates
# We exclude proto_world for documentation (rdoc) purpose
Lint/UselessMethodDefinition:
Enabled: true
Exclude:
- 'lib/cucumber/glue/proto_world.rb'
# TODO: [LH] - Initial 10% reduction done Aug '23 - Further reductions should happen as/when we fix a bunch of the todo
# to the auto-gen-config
Metrics/AbcSize:
Max: 41
# TODO: Manually added! - be careful with regenning the file - this needs a fix
Exclude:
- lib/cucumber/formatter/junit.rb
- spec/cucumber/formatter/http_io_spec.rb
- lib/cucumber/glue/proto_world.rb
# TODO: [LH] - This definitely needs a partial fix / reduction. Even if only an interim one that pushes some stuff
Metrics/ClassLength:
Max: 375
Exclude:
- 'lib/cucumber/cli/options.rb'
# TODO: Manually added! - be careful with regenning the file - this needs a fix
- lib/cucumber/formatter/pretty.rb
# TODO: [LH] - Initial 10% reduction done Aug '23 - Further reductions should happen as/when we fix a bunch of the todo
Metrics/ModuleLength:
Max: 135
Exclude:
- './spec/**/*'
# TODO: Manually added! - be careful with regenning the file - this needs a fix
- lib/cucumber/formatter/console.rb
# TODO: [LH] - Initial 10% reduction done Aug '23 - Further reductions should happen as/when we fix a bunch of the todo
Metrics/MethodLength:
Max: 27
# TODO: Manually added! - be careful with regenning the file - this needs a fix
Exclude:
- lib/cucumber/cli/main.rb
- lib/cucumber/cli/options.rb
- lib/cucumber/formatter/publish_banner_printer.rb
- spec/cucumber/formatter/http_io_spec.rb
- lib/cucumber/glue/proto_world.rb
# Rubocop doesn't like method names in other languages but as Cucumber supports multiple 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:
Exclude:
- 'examples/i18n/ar/lib/calculator.rb'
- 'examples/i18n/he/lib/calculator.rb'
- 'lib/cucumber/glue/dsl.rb'
RSpec/ExampleLength:
CountAsOne: ['array', 'hash', 'heredoc']
# Stylistic preference for cucumber
RSpec/MessageSpies:
EnforcedStyle: receive
# Stylistic preference for cucumber
Style/Documentation:
Enabled: false
Style/FormatStringToken:
EnforcedStyle: annotated
# Stylistic preference for cucumber
Style/RegexpLiteral:
EnforcedStyle: slashes
AllowInnerSlashes: true