Skip to content

Commit 9e560d7

Browse files
authored
Merge pull request #5 from gotomicro/dev
准备 Release v0.0.1
2 parents 1a7c43b + a8dc2a7 commit 9e560d7

20 files changed

+762
-21
lines changed

Diff for: .CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 开发中

Diff for: .deepsource.toml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2021 gotomicro
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
version = 1
16+
17+
[[analyzers]]
18+
name = "go"
19+
enabled = true
20+
21+
[analyzers.meta]
22+
import_root = "github.com/gotomicro/ego-kit"
23+
dependencies_vendored = false
24+
25+
[[analyzers]]
26+
name = "test-coverage"
27+
enabled = true
28+
29+
[[analyzers]]
30+
name = "sql"
31+
enabled = true
32+

Diff for: .github/ISSUE_TEMPLATE/bug_report.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**仅限中文**
11+
12+
在提之前请先查找[已有 issues](https://github.com/gotomicro/eorm/issues),避免重复上报。
13+
14+
并且确保自己已经:
15+
- [ ] 阅读过文档
16+
- [ ] 阅读过注释
17+
- [ ] 阅读过例子
18+
19+
### 问题简要描述
20+
21+
### 复现步骤
22+
> 请提供简单的复现代码
23+
24+
### 错误日志或者截图
25+
26+
### 你期望的结果
27+
28+
### 你排查的结果,或者你觉得可行的修复方案
29+
> 可选。我们希望你能够尽量先排查问题,帮助我们减轻维护负担。这对于你个人能力提升同样是有帮助的。
30+
31+
### 你使用的是 ego-kit 哪个版本?
32+
33+
### 你设置的的 Go 环境?
34+
> 上传 `go env` 的结果

Diff for: .github/ISSUE_TEMPLATE/feature_request.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
**仅限中文**
11+
12+
### 使用场景
13+
14+
### 行业分析
15+
> 如果你知道有框架提供了类似功能,可以在这里描述,并且给出文档或者例子
16+
17+
### 可行方案
18+
> 如果你有设计思路或者解决方案,请在这里提供。你可以提供多个方案,并且给出自己的选择
19+
20+
### 其它
21+
> 任何你觉得有利于解决问题的补充说明
22+
23+
### 你使用的是 ego-kit 哪个版本?
24+
25+
### 你设置的的 Go 环境?
26+
> 上传 `go env` 的结果

Diff for: .github/ISSUE_TEMPLATE/question.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Question
3+
about: Want to ask some questions
4+
title: ''
5+
labels: question
6+
---
7+
8+
**仅限中文**
9+
10+
在提之前请先查找[已有 issues](https://github.com/gotomicro/eorm/issues),避免重复上报。
11+
12+
并且确保自己已经:
13+
- [ ] 阅读过文档
14+
- [ ] 阅读过注释
15+
- [ ] 阅读过例子
16+
17+
### 你的问题
18+
19+
### 你使用的是 ego-kit 哪个版本?
20+
21+
### 你设置的的 Go 环境?
22+
> 上传 `go env` 的结果

Diff for: .github/linters/.golangci.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Copyright 2021 gotomicro
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
run:
16+
timeout: 5m
17+
skip-files:
18+
- generated.*
19+
- gen.*
20+
21+
issues:
22+
new: true
23+
24+
linters:
25+
enable:
26+
- asciicheck
27+
- bodyclose
28+
- deadcode
29+
- depguard
30+
- gci
31+
- gocritic
32+
- gofmt
33+
- gofumpt
34+
- goimports
35+
- goprintffuncname
36+
- gosimple
37+
- govet
38+
- ineffassign
39+
- misspell
40+
- nilerr
41+
- rowserrcheck
42+
- staticcheck
43+
- structcheck
44+
- stylecheck
45+
- typecheck
46+
- unconvert
47+
- unused
48+
- unparam
49+
- varcheck
50+
- whitespace
51+
- errcheck
52+
# disable:
53+
54+
linters-settings:
55+
gci:
56+
local-prefixes: github.com/gotomicro/ego-kit
57+
goimports:
58+
local-prefixes: github.com/gotomicro/ego-kit

Diff for: .github/pre-push

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/sh
2+
# Copyright 2021 gotomicro
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# git test pre-push hook
16+
#
17+
# To use, store as .git/hooks/pre-push inside your repository and make sure
18+
# it has execute permissions.
19+
#
20+
# This script does not handle file names that contain spaces.
21+
22+
# Pre-push configuration
23+
remote=$1
24+
url=$2
25+
echo >&2 "Try pushing $2 to $1"
26+
27+
TEST="go test ./... -race -cover -failfast"
28+
LINTER="golangci-lint run"
29+
30+
# Run test and return if failed
31+
printf "Running go test..."
32+
$TEST
33+
RESULT=$?
34+
if [ $RESULT -ne 0 ]; then
35+
echo >&2 "$TEST"
36+
echo >&2 "Check code to pass test."
37+
exit 1
38+
fi
39+
40+
# Run linter and return if failed
41+
printf "Running go linter..."
42+
$LINTER
43+
RESULT=$?
44+
if [ $RESULT -ne 0 ]; then
45+
echo >&2 "$LINTER"
46+
echo >&2 "Check code to pass linter."
47+
exit 1
48+
fi
49+
50+
exit 0

Diff for: .github/workflows/changelog.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2021 gotomicro
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: changelog
16+
17+
on:
18+
pull_request:
19+
types: [opened, synchronize, reopened, labeled, unlabeled]
20+
branches:
21+
- develop
22+
- main
23+
24+
jobs:
25+
changelog:
26+
runs-on: ubuntu-latest
27+
if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')"
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Check for CHANGELOG changes
33+
run: |
34+
# Only the latest commit of the feature branch is available
35+
# automatically. To diff with the base branch, we need to
36+
# fetch that too (and we only need its latest commit).
37+
git fetch origin ${{ github.base_ref }} --depth=1
38+
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
39+
then
40+
echo "A CHANGELOG was modified. Looks good!"
41+
else
42+
echo "No CHANGELOG was modified."
43+
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
44+
false
45+
fi

Diff for: .github/workflows/go.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2021 gotomicro
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Go
16+
17+
on:
18+
push:
19+
branches: [ main ]
20+
pull_request:
21+
branches: [ main ]
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set up Go
29+
uses: actions/setup-go@v2
30+
with:
31+
go-version: 1.18
32+
33+
- name: Build
34+
run: go build -v ./...
35+
36+
- name: Test
37+
run: go test -race -coverprofile=cover.out -v ./...
38+
39+
- name: Post Coverage
40+
uses: codecov/codecov-action@v2

Diff for: .github/workflows/license.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2021 gotomicro
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Check License Lines
16+
on:
17+
pull_request:
18+
types: [opened, synchronize, reopened, labeled, unlabeled]
19+
branches:
20+
- develop
21+
- main
22+
jobs:
23+
check-license-lines:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@master
27+
- name: Check License Lines
28+
uses: kt3k/[email protected]

Diff for: .github/workflows/stale.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2021 gotomicro
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Mark stale issues and pull requests
16+
17+
on:
18+
schedule:
19+
- cron: "30 1 * * *"
20+
21+
jobs:
22+
stale:
23+
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- uses: actions/stale@v4
28+
with:
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
stale-issue-message: 'This issue is inactive for a long time.'
31+
stale-pr-message: 'This PR is inactive for a long time'
32+
stale-issue-label: 'inactive-issue'
33+
stale-pr-label: 'inactive-pr'

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313

1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
16+
17+
.idea

Diff for: .licenserc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"**/*.go": "// Copyright 2021 gotomicro",
3+
"**/*.{yml,toml}": "# Copyright 2021 gotomicro"
4+
"**/*.sh": "# Copyright 2021 gotomicro"
5+
}

0 commit comments

Comments
 (0)