Skip to content

Commit 06e60c2

Browse files
committed
license, github actions, linter config, gitignore
1 parent e939b6e commit 06e60c2

13 files changed

+512
-4
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ConduitIO/conduit-core

.github/dependabot.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Docs: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
5+
# Maintain dependencies for GitHub Actions
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"
10+
commit-message:
11+
prefix: ".github:"
12+
13+
# Maintain dependencies for Go
14+
- package-ecosystem: "gomod"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
commit-message:
19+
prefix: "go.mod:"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This action automatically merges dependabot PRs that update go dependencies (only patch and minor updates).
2+
# Based on: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
3+
4+
name: Dependabot auto-merge
5+
on:
6+
pull_request:
7+
# Run this action when dependabot labels the PR, we care about the 'go' label.
8+
types: [labeled]
9+
10+
permissions:
11+
pull-requests: write
12+
contents: write
13+
14+
jobs:
15+
dependabot-go:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.actor == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'go') }}
18+
steps:
19+
- name: Dependabot metadata
20+
id: metadata
21+
uses: dependabot/[email protected]
22+
with:
23+
github-token: "${{ secrets.GITHUB_TOKEN }}"
24+
25+
- name: Approve PR
26+
# Approve only patch and minor updates
27+
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
28+
run: gh pr review --approve "$PR_URL"
29+
env:
30+
PR_URL: ${{ github.event.pull_request.html_url }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Enable auto-merge for Dependabot PRs
34+
# Enable auto-merging only for patch and minor updates
35+
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
36+
run: gh pr merge --auto --squash "$PR_URL"
37+
env:
38+
PR_URL: ${{ github.event.pull_request.html_url }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
golangci-lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version-file: 'go.mod'
16+
17+
- name: golangci-lint
18+
uses: golangci/golangci-lint-action@v6
19+
with:
20+
version: "v1.61.0"
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: project-management
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
project-mgmt:
9+
uses: ConduitIO/automation/.github/workflows/project-automation.yml@main
10+
secrets:
11+
project-automation-token: ${{ secrets.PROJECT_AUTOMATION }}

.github/workflows/test.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version-file: 'go.mod'
18+
19+
- name: Test
20+
run: go test -race -v ./...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: validate-generated-files
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
validate-generated-files:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version-file: 'go.mod'
16+
17+
# This step sets up the variable steps.mockgen-version.outputs.v
18+
# to contain the version of mockgen (e.g. v0.5.0).
19+
# The version is taken from go.mod.
20+
- name: Mockgen version
21+
id: mockgen-version
22+
run: |
23+
MOCKGEN_VERSION=$( go list -m -f '{{.Version}}' go.uber.org/mock )
24+
echo "v=$MOCKGEN_VERSION" >> "$GITHUB_OUTPUT"
25+
26+
- name: Check generated files
27+
env:
28+
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
29+
run: |
30+
export PATH=$PATH:$(go env GOPATH)/bin
31+
go install go.uber.org/mock/mockgen@${{ steps.mockgen-version.outputs.v }}
32+
go generate ./...
33+
git diff --exit-code --numstat

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### Go ###
2+
# Binaries for programs and plugins
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
/vendor
9+
10+
# Test binary, built with `go test -c`
11+
*.test
12+
13+
# Output of the go coverage tool, specifically when used with LiteIDE
14+
*.out
15+
16+
### Intellij ###
17+
.idea
18+
19+
### VisualStudioCode ###
20+
.vscode
21+
22+
### macOS ###
23+
.DS_Store

.golangci.goheader.template

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright © {{ copyright-year }} Meroxa, Inc.
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.

.golangci.yml

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
run:
2+
timeout: 5m
3+
4+
linters-settings:
5+
nolintlint:
6+
allow-unused: false # report any unused nolint directives
7+
require-explanation: true # require an explanation for nolint directives
8+
require-specific: true # require nolint directives to mention the specific linter being suppressed
9+
goconst:
10+
ignore-tests: true
11+
goheader:
12+
template-path: '.golangci.goheader.template'
13+
values:
14+
regexp:
15+
copyright-year: 20[2-9]\d
16+
wrapcheck:
17+
ignoreSigs:
18+
- .Errorf(
19+
- errors.New(
20+
- errors.Unwrap(
21+
- errors.Join(
22+
- .Wrap(
23+
- .Wrapf(
24+
- .WithMessage(
25+
- .WithMessagef(
26+
- .WithStack(
27+
- (context.Context).Err()
28+
29+
issues:
30+
exclude-rules:
31+
- path: _test\.go
32+
linters:
33+
- dogsled
34+
- gosec
35+
- gocognit
36+
- errcheck
37+
- forcetypeassert
38+
- funlen
39+
- dupl
40+
- maintidx
41+
42+
linters:
43+
# please, do not use `enable-all`: it's deprecated and will be removed soon.
44+
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
45+
disable-all: true
46+
enable:
47+
- asasalint
48+
- asciicheck
49+
- bidichk
50+
- bodyclose
51+
- containedctx
52+
- contextcheck
53+
- copyloopvar
54+
- decorder
55+
# - depguard
56+
- dogsled
57+
- dupl
58+
- dupword
59+
- durationcheck
60+
# - err113
61+
- errcheck
62+
- errchkjson
63+
- errname
64+
- errorlint
65+
- exhaustive
66+
# - forbidigo
67+
- forcetypeassert
68+
- funlen
69+
- gci
70+
- ginkgolinter
71+
- gocheckcompilerdirectives
72+
- gochecknoinits
73+
- gocognit
74+
- goconst
75+
- gocritic
76+
- godot
77+
- gofmt
78+
- gofumpt
79+
- goheader
80+
- goimports
81+
- gomoddirectives
82+
- goprintffuncname
83+
- gosec
84+
- gosimple
85+
- gosmopolitan
86+
- govet
87+
- grouper
88+
- importas
89+
- ineffassign
90+
- interfacebloat
91+
# - ireturn # Doesn't have correct support for generic types https://github.com/butuzov/ireturn/issues/37
92+
- loggercheck
93+
- maintidx
94+
- makezero
95+
- mirror
96+
- misspell
97+
- musttag
98+
- nakedret
99+
- nestif
100+
- nilerr
101+
- nilnil
102+
- noctx
103+
- nolintlint
104+
- nosprintfhostport
105+
- prealloc
106+
- predeclared
107+
- promlinter
108+
- reassign
109+
- revive
110+
- rowserrcheck
111+
- sqlclosecheck
112+
- staticcheck
113+
- stylecheck
114+
- tenv
115+
- testableexamples
116+
- thelper
117+
- unconvert
118+
# - unparam
119+
- unused
120+
- usestdlibvars
121+
- wastedassign
122+
- whitespace
123+
- wrapcheck
124+
- zerologlint

0 commit comments

Comments
 (0)