Skip to content

Commit 8073195

Browse files
authored
Merge pull request #122 from publify/update-rubocop-configuration
Update RuboCop configuration and autocorrect new offenses
2 parents eb8118e + d07c769 commit 8073195

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.rubocop.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inherit_mode:
44
merge:
55
- Exclude
66

7-
require:
7+
plugins:
88
- rubocop-capybara
99
- rubocop-factory_bot
1010
- rubocop-performance
@@ -23,6 +23,14 @@ AllCops:
2323
Rails:
2424
Enabled: true
2525

26+
# Require tests to specify whether an element is a link or a button
27+
Capybara/ClickLinkOrButtonStyle:
28+
EnforcedStyle: strict
29+
30+
# Match style of regular expectations
31+
Capybara/NegationMatcher:
32+
EnforcedStyle: not_to
33+
2634
# Put development dependencies in the gemspec so rubygems.org knows about them
2735
Gemspec/DevelopmentDependencies:
2836
EnforcedStyle: gemspec
@@ -103,6 +111,10 @@ Rails/SkipsModelValidations:
103111
Exclude:
104112
- 'spec/dummy/db/migrate/*'
105113

114+
# Spec type inference is disabled, so this cop must be disabled too.
115+
RSpecRails/InferredSpecType:
116+
Enabled: false
117+
106118
# Allow the use of 'and' 'or' in control structures.
107119
Style/AndOr:
108120
EnforcedStyle: conditionals
@@ -163,14 +175,6 @@ Style/StringLiteralsInInterpolation:
163175
Style/SymbolArray:
164176
EnforcedStyle: brackets
165177

166-
# Prefer consistent lines for multi-line arrays
167-
Style/TrailingCommaInArrayLiteral:
168-
EnforcedStyleForMultiline: comma
169-
170-
# Prefer consistent lines for multi-line hashes
171-
Style/TrailingCommaInHashLiteral:
172-
EnforcedStyleForMultiline: comma
173-
174178
# Allow small arrays of words with quotes
175179
Style/WordArray:
176180
MinSize: 4

spec/dummy/config/environments/development.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
config.cache_store = :memory_store
2323
config.public_file_server.headers = {
24-
"Cache-Control" => "public, max-age=#{2.days.to_i}",
24+
"Cache-Control" => "public, max-age=#{2.days.to_i}"
2525
}
2626
else
2727
config.action_controller.perform_caching = false

spec/dummy/config/environments/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Configure public file server for tests with Cache-Control for performance.
1818
config.public_file_server.enabled = true
1919
config.public_file_server.headers = {
20-
"Cache-Control" => "public, max-age=#{1.hour.to_i}",
20+
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
2121
}
2222

2323
# Show full error reports and disable caching.

0 commit comments

Comments
 (0)