diff options
| author | Jeff Carr <[email protected]> | 2025-08-31 16:24:37 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-31 16:24:37 -0500 |
| commit | 1eeab586708e3535eadea6e7995a957988555dbf (patch) | |
| tree | de23a91a4237cbad6f7cae1b8b4585563e5945cb /doStrict.go | |
| parent | a29e10e9116f4d5ab80210b3eb8e25b674d3338f (diff) | |
Diffstat (limited to 'doStrict.go')
| -rw-r--r-- | doStrict.go | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/doStrict.go b/doStrict.go index a1d1f28..8e49b8f 100644 --- a/doStrict.go +++ b/doStrict.go @@ -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 } |
