Skip to content

Commit

Permalink
Merge pull request #23319 from Fryguy/sort_severity_npm_audit
Browse files Browse the repository at this point in the history
Sort npm audit pending list by severity
  • Loading branch information
jrafanie authored Jan 28, 2025
2 parents 6518977 + c1e58f3 commit 50bd91d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/tasks/test_security_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def self.all(format: "human")
raise SecurityTestFailed unless success
end

YARN_AUDIT_SEVERITY_SORT = %w[critical high moderate low info]

def self.rebuild_yarn_audit_pending
if defined?(ENGINE_ROOT)
engine_root = ENGINE_ROOT
Expand Down Expand Up @@ -164,6 +166,7 @@ def self.rebuild_yarn_audit_pending
end

values
.sort_by { |v| YARN_AUDIT_SEVERITY_SORT.index(v[1]) || Float::MAX }
.tableize(:header => false)
.lines
.map { |l| l.sub(/^ /, "# ") }
Expand Down

0 comments on commit 50bd91d

Please sign in to comment.