Skip to content

Commit

Permalink
Merge pull request #5 from gotomicro/dev
Browse files Browse the repository at this point in the history
准备 Release v0.0.1
  • Loading branch information
flycash authored Jun 11, 2022
2 parents 1a7c43b + a8dc2a7 commit 9e560d7
Show file tree
Hide file tree
Showing 20 changed files with 762 additions and 21 deletions.
1 change: 1 addition & 0 deletions .CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 开发中
32 changes: 32 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2021 gotomicro
#
# 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.

version = 1

[[analyzers]]
name = "go"
enabled = true

[analyzers.meta]
import_root = "github.com/gotomicro/ego-kit"
dependencies_vendored = false

[[analyzers]]
name = "test-coverage"
enabled = true

[[analyzers]]
name = "sql"
enabled = true

34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**仅限中文**

在提之前请先查找[已有 issues](https://github.com/gotomicro/eorm/issues),避免重复上报。

并且确保自己已经:
- [ ] 阅读过文档
- [ ] 阅读过注释
- [ ] 阅读过例子

### 问题简要描述

### 复现步骤
> 请提供简单的复现代码
### 错误日志或者截图

### 你期望的结果

### 你排查的结果,或者你觉得可行的修复方案
> 可选。我们希望你能够尽量先排查问题,帮助我们减轻维护负担。这对于你个人能力提升同样是有帮助的。
### 你使用的是 ego-kit 哪个版本?

### 你设置的的 Go 环境?
> 上传 `go env` 的结果
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature
assignees: ''

---

**仅限中文**

### 使用场景

### 行业分析
> 如果你知道有框架提供了类似功能,可以在这里描述,并且给出文档或者例子
### 可行方案
> 如果你有设计思路或者解决方案,请在这里提供。你可以提供多个方案,并且给出自己的选择
### 其它
> 任何你觉得有利于解决问题的补充说明
### 你使用的是 ego-kit 哪个版本?

### 你设置的的 Go 环境?
> 上传 `go env` 的结果
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Question
about: Want to ask some questions
title: ''
labels: question
---

**仅限中文**

在提之前请先查找[已有 issues](https://github.com/gotomicro/eorm/issues),避免重复上报。

并且确保自己已经:
- [ ] 阅读过文档
- [ ] 阅读过注释
- [ ] 阅读过例子

### 你的问题

### 你使用的是 ego-kit 哪个版本?

### 你设置的的 Go 环境?
> 上传 `go env` 的结果
58 changes: 58 additions & 0 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2021 gotomicro
#
# 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.

run:
timeout: 5m
skip-files:
- generated.*
- gen.*

issues:
new: true

linters:
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- gci
- gocritic
- gofmt
- gofumpt
- goimports
- goprintffuncname
- gosimple
- govet
- ineffassign
- misspell
- nilerr
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- unparam
- varcheck
- whitespace
- errcheck
# disable:

linters-settings:
gci:
local-prefixes: github.com/gotomicro/ego-kit
goimports:
local-prefixes: github.com/gotomicro/ego-kit
50 changes: 50 additions & 0 deletions .github/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh
# Copyright 2021 gotomicro
#
# 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.
# git test pre-push hook
#
# To use, store as .git/hooks/pre-push inside your repository and make sure
# it has execute permissions.
#
# This script does not handle file names that contain spaces.

# Pre-push configuration
remote=$1
url=$2
echo >&2 "Try pushing $2 to $1"

TEST="go test ./... -race -cover -failfast"
LINTER="golangci-lint run"

# Run test and return if failed
printf "Running go test..."
$TEST
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo >&2 "$TEST"
echo >&2 "Check code to pass test."
exit 1
fi

# Run linter and return if failed
printf "Running go linter..."
$LINTER
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo >&2 "$LINTER"
echo >&2 "Check code to pass linter."
exit 1
fi

exit 0
45 changes: 45 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2021 gotomicro
#
# 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.

name: changelog

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- develop
- main

jobs:
changelog:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')"

steps:
- uses: actions/checkout@v2

- name: Check for CHANGELOG changes
run: |
# Only the latest commit of the feature branch is available
# automatically. To diff with the base branch, we need to
# fetch that too (and we only need its latest commit).
git fetch origin ${{ github.base_ref }} --depth=1
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
then
echo "A CHANGELOG was modified. Looks good!"
else
echo "No CHANGELOG was modified."
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
false
fi
40 changes: 40 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2021 gotomicro
#
# 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.

name: Go

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18

- name: Build
run: go build -v ./...

- name: Test
run: go test -race -coverprofile=cover.out -v ./...

- name: Post Coverage
uses: codecov/codecov-action@v2
28 changes: 28 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 gotomicro
#
# 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.

name: Check License Lines
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- develop
- main
jobs:
check-license-lines:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Check License Lines
uses: kt3k/[email protected]
33 changes: 33 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2021 gotomicro
#
# 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.

name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is inactive for a long time.'
stale-pr-message: 'This PR is inactive for a long time'
stale-issue-label: 'inactive-issue'
stale-pr-label: 'inactive-pr'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

.idea
5 changes: 5 additions & 0 deletions .licenserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"**/*.go": "// Copyright 2021 gotomicro",
"**/*.{yml,toml}": "# Copyright 2021 gotomicro"
"**/*.sh": "# Copyright 2021 gotomicro"
}
Loading

0 comments on commit 9e560d7

Please sign in to comment.