diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e69de29..0000000 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33d9b69..09f5fdc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -208,7 +208,7 @@ To be honest, we regard every user of OpenKFas a very kind contributor. After ex Since we collaborate project OpenKF in a distributed way, we appreciate **WELL-WRITTEN**, **DETAILED**, **EXPLICIT** issue reports. To make the communication more efficient, we wish everyone could search if your issue is an existing one in the searching list. If you find it existing, please add your details in comments under the existing issue instead of opening a brand new one. -To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](https://github.com/OpenIMSDK/OpenKF/issues/new/choose) for issue reporters. You can find three kinds of issue templates there: question, bug report and feature request. Please **BE SURE** to follow the instructions to fill fields in template. +To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](https://github.com/OpenIMSDK/.github/tree/main/.github/ISSUE_TEMPLATE) for issue reporters. You can find three kinds of issue templates there: question, bug report and feature request. Please **BE SURE** to follow the instructions to fill fields in template. **There are a lot of cases when you could open an issue:** @@ -273,7 +273,7 @@ An example for this could be: #### PR Description -PR is the only way to make change to OpenKF project files. To help reviewers better get your purpose, **PR** description could not be too detailed. We encourage contributors to follow the [PR template](https://github.com/OpenIMSDK/OpenKF/tree/main/.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request. +PR is the only way to make change to OpenKF project files. To help reviewers better get your purpose, **PR** description could not be too detailed. We encourage contributors to follow the [PR template](https://github.com/OpenIMSDK/.github/blob/main/.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request. You can find some very formal PR in [RFC](https://github.com/OpenIMSDK/OpenKF/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them. diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg index 66b40d0..3995523 100644 --- a/scripts/githooks/commit-msg +++ b/scripts/githooks/commit-msg @@ -74,4 +74,18 @@ then printError "Please fix your commit message to match kubecub coding standards" printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md" exit 1 +fi + +### Add Sign-off-by line to the end of the commit message +# Get local git config +NAME=$(git config user.name) +EMAIL=$(git config user.email) + +# Check if the commit message contains a sign-off line +grep -qs "^Signed-off-by: " "$1" +SIGNED_OFF_BY_EXISTS=$? + +# Add "Signed-off-by" line if it doesn't exist +if [ $SIGNED_OFF_BY_EXISTS -ne 0 ]; then + echo -e "\nSigned-off-by: $NAME <$EMAIL>" >> "$1" fi \ No newline at end of file diff --git a/server/cmd/genhooks/main.go b/server/cmd/genhooks/main.go index dcd13b3..1ee02f3 100644 --- a/server/cmd/genhooks/main.go +++ b/server/cmd/genhooks/main.go @@ -24,14 +24,14 @@ import ( var ( hookName string urlPattern string - prority int64 + priority int64 savePath string ) func init() { flag.StringVar(&hookName, "name", "", "hook name") flag.StringVar(&urlPattern, "pattern", "", "url pattern") - flag.Int64Var(&prority, "prority", 0, "hook prority") + flag.Int64Var(&priority, "priority", 0, "hook priority") flag.StringVar(&savePath, "path", "../../internal/middleware/hooks", "save path") flag.Parse() @@ -42,5 +42,5 @@ func init() { } func main() { - pkg.NewHookGenerator(hookName, urlPattern, savePath, prority).Generate().Format().Flush() + pkg.NewHookGenerator(hookName, urlPattern, savePath, priority).Generate().Format().Flush() } diff --git a/server/cmd/genhooks/pkg/gen.go b/server/cmd/genhooks/pkg/gen.go index b81893e..75a6a8b 100644 --- a/server/cmd/genhooks/pkg/gen.go +++ b/server/cmd/genhooks/pkg/gen.go @@ -33,17 +33,17 @@ type HookGenerator struct { type config struct { HookName string UrlPattern string - Prority int64 + Priority int64 } // NewHookGenerator returns a new HookGenerator -func NewHookGenerator(hookName, urlPattern, savePath string, prority int64) *HookGenerator { +func NewHookGenerator(hookName, urlPattern, savePath string, priority int64) *HookGenerator { return &HookGenerator{ buf: bytes.NewBuffer(nil), config: &config{ HookName: hookName, UrlPattern: urlPattern, - Prority: prority, + Priority: priority, }, savePath: savePath, } diff --git a/server/cmd/genhooks/pkg/template.go b/server/cmd/genhooks/pkg/template.go index 138880f..ee5886e 100644 --- a/server/cmd/genhooks/pkg/template.go +++ b/server/cmd/genhooks/pkg/template.go @@ -56,6 +56,11 @@ func (h {{.HookName}}) Pattern() string { return "{{.UrlPattern}}" } +// EDIT THIS TO YOUR OWN HOOK PRIORITY +func (h GlobalHook) Priority() int64 { + return {{.Prority}} +} + // EDIT THIS TO YOUR OWN HOOK BEFORE RUN func (h {{.HookName}}) BeforeRun(c *gin.Context) { c.Next() diff --git a/server/go.mod b/server/go.mod index ebcd2b5..6d04e82 100644 --- a/server/go.mod +++ b/server/go.mod @@ -1,6 +1,6 @@ module github.com/OpenIMSDK/OpenKF/server -go 1.18 +go 1.19 require ( github.com/Delta456/box-cli-maker/v2 v2.3.0