Enable new rules and run Rubocop autocorrect (#12232)
This commit is contained in:
parent
636f4b0ae1
commit
c2c1366a4d
3 changed files with 19 additions and 7 deletions
23
.rubocop.yml
23
.rubocop.yml
|
|
@ -39,6 +39,10 @@ Layout/ClassStructure:
|
|||
StyleGuide: '#consistent-classes'
|
||||
Enabled: true
|
||||
|
||||
Lint/DeprecatedConstants:
|
||||
Description: 'Checks for deprecated constants.'
|
||||
Enabled: true
|
||||
|
||||
Layout/DotPosition:
|
||||
Description: 'Checks the position of the dot in multi-line method calls.'
|
||||
StyleGuide: '#consistent-multi-line-chains'
|
||||
|
|
@ -125,6 +129,10 @@ Layout/MultilineMethodCallIndentation:
|
|||
Enabled: true
|
||||
EnforcedStyle: indented
|
||||
|
||||
Lint/RedundantDirGlobSort:
|
||||
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundMethodCallOperator:
|
||||
Description: 'Checks method call operators to not have spaces around them.'
|
||||
Enabled: true
|
||||
|
|
@ -404,11 +412,10 @@ Style/Encoding:
|
|||
Description: 'Use UTF-8 as the source file encoding.'
|
||||
Enabled: false
|
||||
|
||||
Style/HashExcept:
|
||||
Description: >-
|
||||
Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
|
||||
that can be replaced with `Hash#except` method.
|
||||
Enabled: true
|
||||
Style/EndlessMethod:
|
||||
Description: 'Avoid the use of multi-lined endless method definitions.'
|
||||
StyleGuide: '#endless-methods'
|
||||
Enabled: pending
|
||||
|
||||
Style/ExponentialNotation:
|
||||
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
||||
|
|
@ -446,6 +453,12 @@ Style/HashEachMethods:
|
|||
StyleGuide: '#hash-each'
|
||||
Enabled: true
|
||||
|
||||
Style/HashExcept:
|
||||
Description: >-
|
||||
Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
|
||||
that can be replaced with `Hash#except` method.
|
||||
Enabled: true
|
||||
|
||||
Style/HashLikeCase:
|
||||
Description: >-
|
||||
Checks for places where `case-when` represents a simple 1:1
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ RSpec.describe "Comments", type: :request do
|
|||
expect(response.body).not_to include('<meta name="googlebot" content="noindex">')
|
||||
end
|
||||
|
||||
it "displays noindex if comment has score of less than 0" do
|
||||
it "displays noindex if commentable has score of less than 0" do
|
||||
comment.commentable.update_column(:score, -5)
|
||||
get comment.path
|
||||
expect(response.body).to include('<meta name="googlebot" content="noindex">')
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ RSpec.describe Articles::Feeds::LargeForemExperimental, type: :service do
|
|||
let(:tagged_article) { create(:article, tags: tag) }
|
||||
|
||||
it "returns published articles" do
|
||||
|
||||
result = feed.published_articles_by_tag
|
||||
expect(result).to include article
|
||||
expect(result).not_to include unpublished_article
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue