Skip to content

Commit

Permalink
chore: Fix Rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
heyvito committed Mar 13, 2024
1 parent 11a5c4d commit 56c92d6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ Naming/FileName:

Style/Documentation:
Enabled: false

Metrics/CyclomaticComplexity:
Exclude:
- bin/fetch-icons

Metrics/PerceivedComplexity:
Exclude:
- bin/fetch-icons
27 changes: 14 additions & 13 deletions bin/fetch-icons
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ def extract_changes!
added_icons = []

status = system!("git status --porcelain")
.split("\n")
.filter { _1 =~ /icons\/original/ }
.map(&:strip)
.map { _1.split(' ', 2) }
.each do |i|
status, path = i
name = Pathname.new(path).basename.to_s.gsub(/\.svg/, '')
if status == "M"
updated_icons << name
else
added_icons << name
end
.split("\n")
.filter { _1 =~ %r{icons/original} }
.map(&:strip)
.map { _1.split(" ", 2) }
.each do |i|
status, path = i
name = Pathname.new(path).basename.to_s.gsub(".svg", "")
if status == "M"
updated_icons << name
else
added_icons << name
end
end
[added_icons, updated_icons]
end

Expand Down Expand Up @@ -177,6 +177,7 @@ def amend_changelog!(file, data)
cursor = 1
lines[1...].each do |line|
break if line.start_with? "## "

cursor += 1
if line.start_with? ADDED_HEADER
section = :added
Expand All @@ -189,7 +190,7 @@ def amend_changelog!(file, data)
next
end

line = line.gsub(/^\s*-\s*/, '').strip
line = line.gsub(/^\s*-\s*/, "").strip
next if line.empty?

case section
Expand Down

0 comments on commit 56c92d6

Please sign in to comment.