Skip to content

Commit

Permalink
Enable some rubocop rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Oct 1, 2023
1 parent f208874 commit f2ce0df
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
13 changes: 0 additions & 13 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,18 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Enabled: false

Minitest/AssertPredicate:
Enabled: false

Minitest/EmptyLineBeforeAssertionMethods:
Enabled: false

Minitest/MultipleAssertions:
Enabled: false

Minitest/RefutePredicate:
Enabled: false

Style/Documentation:
Enabled: false

Style/EmptyMethod:
EnforcedStyle: expanded

Style/GuardClause:
Enabled: false

Style/HashSyntax:
EnforcedShorthandSyntax: never

Expand Down Expand Up @@ -112,9 +103,5 @@ Style/TrailingCommaInArrayLiteral:
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma

Rails/Output:
Exclude:
- db/*.rb

Rails/OutputSafety:
Enabled: false
6 changes: 3 additions & 3 deletions app/models/artist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def enqueue_all_urls

def oldest_last_scraped_at
scraper_urls = artist_urls.select(&:scraper_enabled?)
if scraper_urls.none? { |artist_url| artist_url.last_scraped_at.nil? }
scraper_urls.map(&:last_scraped_at).min
end
return nil if scraper_urls.any? { |artist_url| artist_url.last_scraped_at.nil? }

scraper_urls.map(&:last_scraped_at).min
end

def not_uploaded
Expand Down
2 changes: 1 addition & 1 deletion test/logical/sites/scraper_definition_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ScraperDefinitionTest < ActiveSupport::TestCase
definition = Sites.from_enum("twitter")

assert_empty(definition.missing_config_keys)
assert(definition.scraper_enabled?)
assert_predicate(definition, :scraper_enabled?)
end

it "returns false if the scraper is manually disabled" do
Expand Down
2 changes: 1 addition & 1 deletion test/model/submission_file_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SubmissionFileTest < ActiveSupport::TestCase
it "can be omitted for testing purposes" do
sm = create(:submission_file)
assert_not sm.original.attached?
assert sm.valid?
assert_predicate(sm, :valid?)
end
end
end

0 comments on commit f2ce0df

Please sign in to comment.