This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch stablize/summary in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git
commit 8b0ca5cc6d905d39ea0356392614344ccb8f06da Author: kezhenxu94 <[email protected]> AuthorDate: Sun Jun 12 16:00:33 2022 +0800 Stablize summary context to perform consistant output --- dist/LICENSE | 57 +++++++++++++++++++++++++++++------------------------ pkg/deps/summary.go | 7 +++++++ 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/dist/LICENSE b/dist/LICENSE index 65412f2..b3bb8b0 100644 --- a/dist/LICENSE +++ b/dist/LICENSE @@ -174,31 +174,6 @@ of your accepting any such warranty or additional liability. -======================================================================== -ISC licenses -======================================================================== - - github.com/davecgh/go-spew v1.1.1 ISC - -======================================================================== -MPL-2.0 licenses -======================================================================== - - github.com/hashicorp/golang-lru v0.5.1 MPL-2.0 - -======================================================================== -BSD-2-Clause licenses -======================================================================== - - github.com/russross/blackfriday/v2 v2.1.0 BSD-2-Clause - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 BSD-2-Clause - -======================================================================== -MIT and Apache licenses -======================================================================== - - gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 MIT and Apache - ======================================================================== Apache-2.0 licenses ======================================================================== @@ -229,12 +204,18 @@ Apache-2.0 licenses google.golang.org/grpc v1.31.0 Apache-2.0 gopkg.in/yaml.v2 v2.4.0 Apache-2.0 +======================================================================== +BSD-2-Clause licenses +======================================================================== + + github.com/russross/blackfriday/v2 v2.1.0 BSD-2-Clause + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 BSD-2-Clause + ======================================================================== BSD-3-Clause licenses ======================================================================== dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 BSD-3-Clause - github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 BSD-3-Clause github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 BSD-3-Clause github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 BSD-3-Clause github.com/golang/protobuf v1.5.2 BSD-3-Clause @@ -269,6 +250,18 @@ BSD-3-Clause licenses rsc.io/quote/v3 v3.1.0 BSD-3-Clause rsc.io/sampler v1.3.0 BSD-3-Clause +======================================================================== +BSD-3-Clause and GooglePatentClause licenses +======================================================================== + + github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 BSD-3-Clause and GooglePatentClause + +======================================================================== +ISC licenses +======================================================================== + + github.com/davecgh/go-spew v1.1.1 ISC + ======================================================================== MIT licenses ======================================================================== @@ -291,3 +284,15 @@ MIT licenses github.com/yuin/goldmark v1.4.1 MIT honnef.co/go/tools v0.0.1-2020.1.4 MIT +======================================================================== +MIT and Apache-2.0 licenses +======================================================================== + + gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 MIT and Apache-2.0 + +======================================================================== +MPL-2.0 licenses +======================================================================== + + github.com/hashicorp/golang-lru v0.5.1 MPL-2.0 + diff --git a/pkg/deps/summary.go b/pkg/deps/summary.go index d14acb7..5b81219 100644 --- a/pkg/deps/summary.go +++ b/pkg/deps/summary.go @@ -20,6 +20,7 @@ package deps import ( "bytes" "os" + "sort" "text/template" "github.com/apache/skywalking-eyes/pkg/header" @@ -98,7 +99,13 @@ func generateSummaryRenderContext(head *header.ConfigHeader, rep *Report) (*Summ groupArray := make([]*SummaryRenderLicenseGroup, 0) for _, g := range groups { groupArray = append(groupArray, g) + sort.SliceStable(g.Deps, func(i, j int) bool { + return g.Deps[i].Name < g.Deps[j].Name + }) } + sort.SliceStable(groupArray, func(i, j int) bool { + return groupArray[i].LicenseID < groupArray[j].LicenseID + }) return &SummaryRenderContext{ LicenseContent: headerContent, Groups: groupArray,
