Skip to content

Commit

Permalink
chore: improve code commit message generation
Browse files Browse the repository at this point in the history
- Add task `codegpt` to generate code commit messages
- Add dependency on task `swag` for task `codegpt`
- Add commands to run `git add .` and `codegpt commit --diff_unified 5 --exclude_list docs` to task `codegpt`
- Increase the number of unified diffs shown in commit messages to 5 for `codegpt`
- Include `Taskfile.yml` in the diff

Signed-off-by: ysicing <[email protected]>
  • Loading branch information
ysicing committed Mar 20, 2024
1 parent a65d072 commit f0e77e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 34 deletions.
10 changes: 10 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ tasks:

swag:
desc: generate swagger
run: once
cmds:
- task: tools
- swag init -d zentao -g zentao.go
Expand All @@ -76,6 +77,14 @@ tasks:
cmds:
- docker compose -f hack/docker-compose.yml down -v

codegpt:
desc: generate code commit message
deps:
- swag
cmds:
- git add .
- codegpt commit --diff_unified 5 --exclude_list docs

fmt:
cmds:
- task: initgithooks
Expand All @@ -88,3 +97,4 @@ tasks:
cmds:
- task: initgithooks
- task: fmt
- task: codegpt
20 changes: 2 additions & 18 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
//
// Copyright 2024, zentao
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Package main Code generated by swaggo/swag at 2024-03-20 14:28:47.181671 +0800 CST m=+0.046797209. DO NOT EDIT
package main
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"

Expand Down
16 changes: 0 additions & 16 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
#
# Copyright 2024, zentao
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

basePath: /api.php/v1
host: zentao.demo.qucheng.cc
info:
Expand Down

0 comments on commit f0e77e1

Please sign in to comment.