Skip to content

Commit

Permalink
Enable some Lint cops to prevent warnings
Browse files Browse the repository at this point in the history
Parity with ActiveAdmin to prevent introduction of new warnings

Manually fix a `Lint/UselessAssignment` warning

Ref: activeadmin/activeadmin#8597
  • Loading branch information
tagliala committed Jan 4, 2025
1 parent bce170c commit 3741eb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ Layout/TrailingWhitespace:
Layout/TrailingEmptyLines:
Enabled: true

Lint/AmbiguousOperator:
Enabled: true

Lint/AmbiguousRegexpLiteral:
Enabled: true

Lint/UselessAssignment:
Enabled: true

Minitest:
Enabled: true

Expand Down
4 changes: 2 additions & 2 deletions lib/inherited_resources/base_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def smart_resource_url
if respond_to? :show
url = resource_url rescue nil
end
url ||= smart_collection_url
url || smart_collection_url
end

# URL to redirect to when redirect implies collection url.
Expand All @@ -309,7 +309,7 @@ def smart_collection_url
if respond_to? :parent, true
url ||= parent_url rescue nil
end
url ||= root_url rescue nil
url || root_url rescue nil
end

# memoize the extraction of attributes from params
Expand Down

0 comments on commit 3741eb3

Please sign in to comment.