forked from sul-dlss/preservation_robots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
138 lines (105 loc) · 3.61 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
inherit_from: .rubocop_todo.yml
# Turn on RSpec cops
require: rubocop-rspec
AllCops:
DisplayCopNames: true
Include:
- Rakefile
- config.ru
- lib/**/*.rake
Exclude:
- Gemfile.lock
- '**/*.md'
- bin/**/*
- config/**/*.yml
- config/environments/*.rb
- script/**/*
- vendor/**/*
Bundler/OrderedGems:
Exclude:
- Gemfile
# --- Layout ---
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/EmptyLinesAroundClassBody:
Enabled: false
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: false
Layout/IndentHeredoc:
Exclude:
- Rakefile # Including it causes the generate_stats table to display poorly
# --- Lint ---
# --- Metrics ---
Metrics/AbcSize:
Exclude:
- lib/activity_reporter.rb # output method is 16.55
- lib/error_reporter.rb
- robots/preservation_ingest/verify_apo.rb # verify_apo_moab is 16.76; couldn't think of a way to be clearer
Metrics/BlockLength:
Exclude:
- spec/**/*
Metrics/CyclomaticComplexity:
Exclude:
- lib/error_reporter.rb
Metrics/LineLength:
Max: 120 # this isn't 1994
Exclude:
- config/schedule.rb # one long cli command
- spec/preservation_ingest/complete_ingest_spec.rb
- spec/preservation_ingest/transfer_object_spec.rb # some long lines with fully namespaced classes
- spec/preservation_ingest/update_catalog_spec.rb # one long line #12
- spec/preservation_ingest/update_moab_spec.rb # one long ling with fully namespaced classes
- spec/preservation_ingest/validate_bag_spec.rb # one long line with fully namespaced classes
- spec/preservation_ingest/verify_apo_spec.rb # one long line with fully namespaced classes
Metrics/MethodLength:
Exclude:
- lib/activity_reporter.rb # converted bash script
- lib/error_reporter.rb
- robots/preservation_ingest/base.rb # execute_shell_command
- robots/preservation_ingest/update_catalog.rb # one too many line [11/10]
Metrics/PerceivedComplexity:
Exclude:
- lib/error_reporter.rb
# --- Naming ---
Naming/FileName:
Exclude:
- Capfile
- Gemfile
# --- Performance ---
# --- RSpec ---
RSpec/ContextWording:
Enabled: false # Don't need to have 'with', 'when', or 'without' in the start of a context block.
RSpec/ExampleLength:
Max: 10
Exclude:
- spec/lib/stats_reporter_spec.rb # mimicking cli output takes many lines
- spec/preservation_ingest/transfer_object_spec.rb # lots of expectations to set up for some specs
RSpec/FilePath:
Enabled: false # paths become long to no gain
RSpec/MessageSpies:
Enabled: false # receive is fine. have_received is fine
RSpec/MultipleExpectations:
Max: 4 # let's not be too pendantic about single expectation per test
Exclude:
- spec/preservation_ingest/transfer_object_spec.rb # lots of expectations to set up for some specs
RSpec/NestedGroups:
Exclude:
- spec/lib/activity_reporter_spec.rb # needed for script
- spec/lib/error_reporter_spec.rb
- spec/preservation_ingest/verify_apo_spec.rb # it goes to 4 but so does the logic
# --- Style ---
Style/FrozenStringLiteralComment:
Enabled: false # avoid cruft in our files for something that MAY be default in Ruby 3.0
Style/SafeNavigation:
Exclude:
- robots/preservation_ingest/verify_apo.rb # can't guarantee late enough ruby version on deployment
Style/StringLiterals:
Enabled: false # ' vs " isn't a big deal for readability or maintainability or execution time
Style/SymbolArray:
Exclude:
- Rakefile # because [:spec, :rubocop] isn't a big deal
Style/TernaryParentheses:
Exclude:
- config/boot.rb # line 37 is clearer with the parens