fix output formatting errors

This commit is contained in:
Jeff Carr 2025-08-31 16:24:37 -05:00
parent a29e10e911
commit 1eeab58670
2 changed files with 29 additions and 16 deletions

View File

@ -50,20 +50,20 @@ func cleanGoDepsCheckOk(check *gitpb.Repo) error {
if forge.Config.IsReadOnly(check.GetGoPath()) {
ends += "(ignoring read-only) "
if argv.Verbose {
log.Printf("%-48s ok error .%s. vs .%s. %s", depRepo.GetGoPath(),
log.Printf("%-48s ok error .%s. vs .%s. %s\n", depRepo.GetGoPath(),
depRepo.GetVersion(), found.GetMasterVersion(), ends)
}
} else {
if forge.CheckOverride(depRepo.GetGoPath()) {
ends += "(override) "
if argv.Verbose {
log.Printf("%-48s ok error .%s. vs .%s. %s", depRepo.GetGoPath(),
log.Printf("%-48s ok error .%s. vs .%s. %s\n", depRepo.GetGoPath(),
depRepo.GetVersion(), found.GetMasterVersion(), ends)
// skip this gopath because it's probably broken forever
}
continue
} else {
log.Printf("%-48s error %10s vs %10s %s", depRepo.GetGoPath(),
log.Printf("%-48s error %10s vs %10s %s\n", depRepo.GetGoPath(),
depRepo.GetVersion(), found.GetMasterVersion(), ends)
errs := fmt.Sprintf("%s error %s vs %s %s", depRepo.GetGoPath(),
depRepo.GetVersion(), found.GetMasterVersion(), ends)

View File

@ -38,8 +38,8 @@ func doStrict(repo *gitpb.Repo) error {
return errors.New(repo.GetGoPath() + " not in the git master branch")
}
err = repo.RepoIgnoresGoMod()
if err != nil {
// not sure if this really needs to be run a second time. probably not, but whatever. who cares
if err := repo.RepoIgnoresGoMod(); err != nil {
log.Info(repo.GetGoPath(), "some wierd git error happened. investigate.", err)
return err
}
@ -91,14 +91,16 @@ func doStrict(repo *gitpb.Repo) error {
}
// the first time, it'll attempt to fix some stuff
log.Info("Running: updateToNewestReleases()")
log.Info(repo.GetGoPath(), "Running: updateToNewestReleases()")
cleanGoDepsCheckOk(repo)
// try to trim junk
log.Info("Running: trimGoSum()")
if err := trimGoSum(repo); err != nil {
log.Info(repo.GetGoPath(), "trimGoSum() failed", err)
return err
if repo.Exists("go.sum") {
// try to trim junk
log.Info(repo.GetGoPath(), "Running: trimGoSum()")
if err := trimGoSum(repo); err != nil {
log.Info(repo.GetGoPath(), "trimGoSum() failed", err)
return err
}
}
if repo.ParseGoSum() {
@ -107,17 +109,28 @@ func doStrict(repo *gitpb.Repo) error {
log.Info(repo.GetGoPath(), "ParseGoSum() failed")
}
// check go.sum file
if err := cleanGoDepsCheckOk(repo); err != nil {
log.Info("forge.FinalGoDepsCheck() failed. boo. :", repo.GetGoPath())
return err
if !repo.GetGoPrimitive() {
// check go.sum file
if err := cleanGoDepsCheckOk(repo); err != nil {
log.Info(repo.GetGoPath(), "forge.FinalGoDepsCheck() failed. boo.")
return err
}
}
if repo.Exists("go.sum") {
// try to trim junk
log.Info(repo.GetGoPath(), "Running: trimGoSum()")
if err := trimGoSum(repo); err != nil {
log.Info(repo.GetGoPath(), "trimGoSum() failed", err)
return err
}
}
// put the files in the notes section in git
// this way, git commits are not messed up
// with this autogenerated code
if err := saveAsMetadata(repo); err != nil {
log.Info("save go.mod as git metadata failed", repo.GetGoPath(), err)
log.Info(repo.GetGoPath(), "save go.mod as git metadata failed", err)
return err
}