Skip to content

Commit 4c7716e

Browse files
MikeMcQuaidRylan12
andauthored
Apply suggestions from code review
Co-authored-by: Rylan Polster <[email protected]>
1 parent 21b5d67 commit 4c7716e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Library/Homebrew/formula_auditor.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ def audit_revision
903903
problem "`revision` should only increment by 1"
904904
end
905905

906-
revision_increment = if (previous_revision = previous_committed[:revision])
906+
revision_increment = if (previous_revision = newest_committed[:revision])
907907
current_revision - previous_revision
908908
else
909909
current_revision
@@ -919,7 +919,7 @@ def audit_revision
919919
missing_compatibility_bumps = changed_dependency_paths.filter_map do |path|
920920
changed_formula = Formulary.factory(path)
921921
# Each changed dependency must raise its compatibility_version by exactly one.
922-
previous_committed_dependency, = committed_version_info(formula: changed_formula)
922+
_, newest_committed_dependency = committed_version_info(formula: changed_formula)
923923
previous_compatibility_version = previous_committed_dependency[:compatibility_version] || 0
924924
current_compatibility_version = changed_formula.compatibility_version || 0
925925
next if current_compatibility_version == previous_compatibility_version + 1
@@ -939,7 +939,7 @@ def audit_compatibility_version
939939
return if tap.nil?
940940
return unless tap.git?
941941

942-
previous_committed, = committed_version_info
942+
_, newest_committed = committed_version_info
943943
return if previous_committed.empty?
944944

945945
previous_compatibility_version = previous_committed[:compatibility_version] || 0
@@ -965,7 +965,7 @@ def audit_compatibility_version
965965
# Only formulae that depend (recursively) on the audited formula can justify the bump.
966966
next unless dependencies.include?(formula.name)
967967

968-
previous_committed_dependent, = committed_version_info(formula: changed_formula)
968+
_, newest_committed_dependent = committed_version_info(formula: changed_formula)
969969
previous_revision = previous_committed_dependent[:revision] || 0
970970
current_revision = changed_formula.revision
971971
next if current_revision != previous_revision + 1
@@ -1168,11 +1168,9 @@ def changed_formulae_paths(tap, only_names: nil)
11681168
absolute_path = tap.formula_dir/relative_path
11691169
absolute_path.expand_path if absolute_path.exist?
11701170
rescue
1171-
nil
1171+
[]
11721172
end.map(&:to_s)
11731173

1174-
return [] if expected_paths.empty?
1175-
11761174
changed_paths.select { |path| expected_paths.include?(path.expand_path.to_s) }
11771175
end
11781176

0 commit comments

Comments
 (0)