Skip to content

Commit afeaaed

Browse files
tatianabgopherbot
authored andcommitted
cmd/vulnreport: remove unneccessary logic from fix
Remove logic to add/fix the Go ID and add TODOs for skip_fix, which are no longer needed. (They existed as part of a transition to adding new fields to the YAML). Change-Id: I9e3e9f709d0d3a110e1dca08a332b624101001ed Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/500495 Run-TryBot: Tatiana Bradley <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Damien Neil <[email protected]> Auto-Submit: Tatiana Bradley <[email protected]>
1 parent 43b8c30 commit afeaaed

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

cmd/vulnreport/main.go

-24
Original file line numberDiff line numberDiff line change
@@ -715,10 +715,6 @@ func fix(ctx context.Context, filename string, ghsaClient *ghsa.Client) (err err
715715
if err != nil {
716716
return err
717717
}
718-
// Add/fix the Go ID if needed.
719-
if goID := report.GoID(filename); goID != r.ID {
720-
r.ID = goID
721-
}
722718
if err := r.CheckFilename(filename); err != nil {
723719
return err
724720
}
@@ -729,9 +725,6 @@ func fix(ctx context.Context, filename string, ghsaClient *ghsa.Client) (err err
729725
warnlog.Printf("%s still has lint errors after fix:\n\t- %s", filename, strings.Join(lints, "\n\t- "))
730726
}
731727

732-
// Adds a todo for a human. Currently outside of the scope of r.Fix()
733-
addSkipFixTodos(r)
734-
735728
if !*skipSymbols {
736729
if err := checkReportSymbols(r); err != nil {
737730
return err
@@ -763,23 +756,6 @@ func fix(ctx context.Context, filename string, ghsaClient *ghsa.Client) (err err
763756
return nil
764757
}
765758

766-
// addSkipFixTodos adds a todo SkipFix to every package in an
767-
// unexcluded module that does not give a VulnerableAt.
768-
func addSkipFixTodos(r *report.Report) {
769-
if r.Excluded != "" {
770-
return
771-
}
772-
for _, m := range r.Modules {
773-
if m.VulnerableAt == "" {
774-
for _, p := range m.Packages {
775-
if p.SkipFix == "" {
776-
p.SkipFix = todo + " [or set vulnerable_at to derive symbols]"
777-
}
778-
}
779-
}
780-
}
781-
}
782-
783759
func checkReportSymbols(r *report.Report) error {
784760
if r.IsExcluded() {
785761
infolog.Printf("%s is excluded, skipping symbol checks\n", r.ID)

0 commit comments

Comments
 (0)