Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Jun 29, 2024
1 parent d8e64da commit 32b3b2a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/api/v1/timelines/public_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ def require_auth?
end

def require_auth_local?
!Setting.timeline_preview_local && truthy_param?(:local)
if Setting.timeline_preview_local && truthy_param?(:local)

Check failure on line 21 in app/controllers/api/v1/timelines/public_controller.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Style/GuardClause: Use a guard clause (return unless Setting.timeline_preview_local && truthy_param?(:local)) instead of wrapping the code inside a conditional expression. (https://rubystyle.guide#no-nested-conditionals)

Check failure on line 21 in app/controllers/api/v1/timelines/public_controller.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Style/IfUnlessModifier: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. (https://rubystyle.guide#if-as-a-modifier)
return true

Check failure on line 22 in app/controllers/api/v1/timelines/public_controller.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Style/RedundantReturn: Redundant return detected. (https://rubystyle.guide#no-explicit-return)
end
end

def require_auth_remote?
!Setting.timeline_preview_remote && truthy_param?(:remote)
if Setting.timeline_preview_remote && truthy_param?(:remote)

Check failure on line 27 in app/controllers/api/v1/timelines/public_controller.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Style/GuardClause: Use a guard clause (return unless Setting.timeline_preview_remote && truthy_param?(:remote)) instead of wrapping the code inside a conditional expression. (https://rubystyle.guide#no-nested-conditionals)

Check failure on line 27 in app/controllers/api/v1/timelines/public_controller.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Style/IfUnlessModifier: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. (https://rubystyle.guide#if-as-a-modifier)
return true

Check failure on line 28 in app/controllers/api/v1/timelines/public_controller.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Style/RedundantReturn: Redundant return detected. (https://rubystyle.guide#no-explicit-return)
end
end

def load_statuses
Expand Down

0 comments on commit 32b3b2a

Please sign in to comment.