Compare commits

..

No commits in common. "db88502414c949f6194654ae0c8b4fe4990229eb" and "e785ce2860e5259b16000540a477276ec2813d23" have entirely different histories.

4 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,3 @@
// Package conf provides a configuration file parser for JOJ3.
// The configuration file path is determined by the commit message.
package conf
import (

1
cmd/joj3/env/env.go vendored
View File

@ -1,4 +1,3 @@
// Package env stores the environment variables from actions environment.
package env
import (

View File

@ -1,3 +1,4 @@
// Referenced from https://github.com/yuriisk/clang-tidy-converter/blob/master/clang_tidy_converter/parser/clang_tidy_parser.py
package clangtidy
import (
@ -5,7 +6,6 @@ import (
"strings"
)
// Referenced from https://github.com/yuriisk/clang-tidy-converter/blob/master/clang_tidy_converter/parser/clang_tidy_parser.py
type JsonMessage struct {
Type string `json:"type"`
CheckName string `json:"checkname"`

19
pkg/util/map.go Normal file
View File

@ -0,0 +1,19 @@
package utils
import "sort"
type Pair[K comparable, V any] struct {
Key K
Value V
}
func SortMap[K comparable, V any](m map[K]V, less func(i, j Pair[K, V]) bool) []Pair[K, V] {
pairs := make([]Pair[K, V], 0, len(m))
for k, v := range m {
pairs = append(pairs, Pair[K, V]{k, v})
}
sort.Slice(pairs, func(i, j int) bool {
return less(pairs[i], pairs[j])
})
return pairs
}