Skip to content

Commit 59d1ae8

Browse files
committed
refactor and add license, workflow
1 parent d33d1f1 commit 59d1ae8

File tree

20 files changed

+379
-67
lines changed

20 files changed

+379
-67
lines changed

.github/workflows/cla.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened,closed,synchronize]
7+
8+
jobs:
9+
CLAssistant:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "CLA Assistant"
13+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
14+
# Beta Release
15+
uses: cla-assistant/github-action@v2.1.3-beta
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
# the below token should have repo scope and must be manually added by you in the repository's secret
19+
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20+
with:
21+
path-to-signatures: 'signatures/version1/cla.json'
22+
path-to-document: 'https://github.com/acmestack/.github/blob/main/AcmeStack-CLA.md' # e.g. a CLA or a DCO document
23+
# branch should not be protected
24+
branch: 'cla'
25+
allowlist: bot*
26+
27+
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
28+
#remote-organization-name: acmestack #enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
29+
#remote-repository-name: cla # enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
30+
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
31+
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
32+
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
33+
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
34+
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
35+
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
36+
#use-dco-flag: true - If you are using DCO instead of CLA

.github/workflows/codeql.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '21 12 * * 4'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'go' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v2

.github/workflows/go.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 1.18
20+
21+
- name: Build
22+
run: go build -v ./...
23+
24+
- name: Test
25+
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic
26+
27+
- uses: codecov/codecov-action@v2

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
*.dll
55
*.so
66
*.dylib
7-
*.zip
87

98
# Test binary, built with `go test -c`
109
*.test
1110

1211
# Output of the go coverage tool, specifically when used with LiteIDE
1312
*.out
1413

15-
# Dependency directories (remove the comment below to include it)
16-
# vendor/
14+
# golang
15+
*.idea
1716

18-
/.idea/
17+
# Dependency directories (remove the comment below to include it)
18+
vendor/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gobatis-plus -i {YOUR_PACKAGE_DIR} -o {OUTPUT_DIR}
77
```
88
example:
99
```
10-
gobatis-plus -i github.com/xfali/gobatis-plus/example -o tmp
10+
gobatis-plus -i github.com/acmestack/gobatis-plus/example -o tmp
1111
```
1212

1313
## Package

cmd/gobatis-plus/customargs/args.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
// Copyright (C) 2019-2022, Xiongfa Li.
2-
// @author xiongfa.li
3-
// @version V1.0
4-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
517

618
package customargs
719

820
import (
921
"fmt"
22+
1023
"github.com/spf13/pflag"
1124
"k8s.io/gengo/args"
1225
)

cmd/gobatis-plus/main.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1-
// Copyright (C) 2019-2022, Xiongfa Li.
2-
// @author xiongfa.li
3-
// @version V1.0
4-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
517

618
package main
719

820
import (
921
"flag"
22+
23+
"github.com/acmestack/gobatis-plus/cmd/gobatis-plus/customargs"
24+
"github.com/acmestack/gobatis-plus/pkg/generator"
1025
"github.com/spf13/pflag"
11-
"github.com/xfali/gobatis-plus/cmd/gobatis-plus/customargs"
12-
"github.com/xfali/gobatis-plus/pkg/generator"
1326
"k8s.io/klog/v2"
1427
)
1528

example/doc.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
// +gobatis:enable
219
package example

example/example.go

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
// Copyright (C) 2019-2022, Xiongfa Li.
2-
// @author xiongfa.li
3-
// @version V1.0
4-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
517

618
package example
719

820
import (
9-
"github.com/xfali/gobatis-plus/pkg/mapper"
1021
"time"
22+
23+
"github.com/acmestack/gobatis-plus/pkg/mapper"
1124
)
1225

1326
// +gobatis:data:tablename=tbl_user

go.mod

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
module github.com/xfali/gobatis-plus
1+
module github.com/acmestack/gobatis-plus
22

33
go 1.18
44

55
require (
66
github.com/spf13/pflag v1.0.5
7-
github.com/xfali/goid v0.0.0-20190301093704-7650c15f1ecc // indirect
87
k8s.io/gengo v0.0.0-20220613173612-397b4ae3bce7
98
k8s.io/klog/v2 v2.2.0
109
)
10+
11+
require (
12+
github.com/go-logr/logr v0.2.0 // indirect
13+
golang.org/x/mod v0.2.0 // indirect
14+
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8 // indirect
15+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
16+
)

0 commit comments

Comments
 (0)