Skip to content

Commit

Permalink
Configure Layout/EndAlignment for better readability
Browse files Browse the repository at this point in the history
I never wanted to indent it that way. Turns out, there is a config for this
  • Loading branch information
Earlopain committed Nov 25, 2024
1 parent 605b419 commit ba823fe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ FactoryBot/AssociationStyle:
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation

Layout/EndAlignment:
EnforcedStyleAlignWith: start_of_line

Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Expand Down
8 changes: 4 additions & 4 deletions app/logical/git_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def self.url
remote = REPO.remotes.find { |r| r.name == "origin" }.url
match = remote.scan(regex).first
@url = if match[0]
"https://#{match[0]}/#{match[1]}/#{match[2]}"
else
"https://#{match[4]}"
end
"https://#{match[0]}/#{match[1]}/#{match[2]}"
else
"https://#{match[4]}"
end
end
end
8 changes: 4 additions & 4 deletions app/logical/scraper/inkbunny.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def initialize(artist_url)

def fetch_next_batch
json = if @rid
search_mode2
else
search_mode1
end
search_mode2
else
search_mode1
end
end_reached if json["pages_count"] == json["page"]
submission_ids = json["submissions"].pluck("submission_id")
submissions = submission_details(submission_ids).reject { |submission| submission["last_file_update_datetime"].nil? }
Expand Down
8 changes: 4 additions & 4 deletions app/logical/scraper/itaku.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def to_submission(submission)
s.created_at = DateTime.parse submission["date_added"]

file_url = if submission["video"].present?
submission["video"]["video"]
else
submission["image"]
end
submission["video"]["video"]
else
submission["image"]
end

s.add_file({
url: file_url,
Expand Down
8 changes: 4 additions & 4 deletions app/logical/scraper/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ def extract_url_from_media(media)
def expand_description(tweet)
range = tweet["display_text_range"]
description = if range[0] == range[1]
""
else
tweet["full_text"][range[0]..range[1]]
end
""
else
tweet["full_text"][range[0]..range[1]]
end

# Ensure replacements get processed right to left
tweet["entities"]["urls"].sort { |a, b| b["indices"][0] - a["indices"][0] }.each do |entry|
Expand Down

0 comments on commit ba823fe

Please sign in to comment.