Skip to content

Commit 9b52c5c

Browse files
authored
Merge pull request #1 from selesy/feat/initial-library
Feat/initial library
2 parents 4d3d03f + e1c2a10 commit 9b52c5c

26 files changed

+1448
-0
lines changed

.codespellrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[codespell]
2+
skip = go.*,**/testdata/**,**/go.*

.commitlintrc

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const Configuration = {
2+
/*
3+
* Resolve and load @commitlint/config-conventional from node_modules.
4+
* Referenced packages must be installed
5+
*/
6+
extends: ["@commitlint/config-conventional"],
7+
/*
8+
* Resolve and load conventional-changelog-atom from node_modules.
9+
* Referenced packages must be installed
10+
*/
11+
parserPreset: "conventional-changelog-atom",
12+
/*
13+
* Resolve and load @commitlint/format from node_modules.
14+
* Referenced package must be installed
15+
*/
16+
formatter: "@commitlint/format",
17+
/*
18+
* Any rules defined here will override rules from @commitlint/config-conventional
19+
*/
20+
rules: {
21+
"type-enum": [2, "always", ["foo"]],
22+
},
23+
/*
24+
* Array of functions that return true if commitlint should ignore the given message.
25+
* Given array is merged with predefined functions, which consist of matchers like:
26+
*
27+
* - 'Merge pull request', 'Merge X into Y' or 'Merge branch X'
28+
* - 'Revert X'
29+
* - 'v1.2.3' (ie semver matcher)
30+
* - 'Automatic merge X' or 'Auto-merged X into Y'
31+
*
32+
* To see full list, check https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/is-ignored/src/defaults.ts.
33+
* To disable those ignores and run rules always, set `defaultIgnores: false` as shown below.
34+
*/
35+
ignores: [(commit) => commit === ""],
36+
/*
37+
* Whether commitlint uses the default ignore rules, see the description above.
38+
*/
39+
defaultIgnores: true,
40+
/*
41+
* Custom URL to show upon failure
42+
*/
43+
helpUrl:
44+
"https://github.com/conventional-changelog/commitlint/#what-is-commitlint",
45+
/*
46+
* Custom prompt configs
47+
*/
48+
prompt: {
49+
messages: {},
50+
questions: {
51+
type: {
52+
description: "please input type:",
53+
},
54+
},
55+
},
56+
};
57+
58+
export default Configuration;

.github/workflows/check.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches-ignore:
7+
- main
8+
9+
env:
10+
GO_VERSION: '1.25.8'
11+
PYTHON_VERSION: '3.10'
12+
13+
jobs:
14+
pre-commit:
15+
permissions:
16+
contents: read
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Setup Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: ${{ env.GO_VERSION }}
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ env.PYTHON_VERSION}}
28+
- name: Cache pre-commit environments
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.cache/pre-commit
32+
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
33+
restore-keys: |
34+
pre-commit-${{ runner.os }}-
35+
- name: Run pre-commit
36+
uses: pre-commit/action@v3.0.1
37+
env:
38+
SKIP: go-test-coverage,golangci-lint-mod,govulncheck,go-generate,trufflehog
39+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/release.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
with:
19+
token: ${{ secrets.RELEASE_PLEASE_PAT }}
20+
release-type: go
21+
config-file: .github/release-please-config.yaml
22+
manifest-file: .release-please-manifest.json

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/go,direnv
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=go,direnv
3+
4+
### direnv ###
5+
.direnv
6+
.envrc
7+
8+
### Go ###
9+
# If you prefer the allow list template instead of the deny list, see community template:
10+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
11+
#
12+
# Binaries for programs and plugins
13+
*.exe
14+
*.exe~
15+
*.dll
16+
*.so
17+
*.dylib
18+
19+
# Test binary, built with `go test -c`
20+
*.test
21+
22+
# Output of the go coverage tool, specifically when used with LiteIDE
23+
*.out
24+
25+
# Dependency directories (remove the comment below to include it)
26+
# vendor/
27+
28+
# Go workspace file
29+
go.work
30+
31+
# End of https://www.toptal.com/developers/gitignore/api/go,direnv

.golangci.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: "2"
2+
run:
3+
go: "1.24"
4+
modules-download-mode: readonly
5+
linters:
6+
enable:
7+
- errname
8+
- errorlint
9+
- gocyclo
10+
- misspell
11+
- staticcheck
12+
- gosec
13+
settings:
14+
misspell:
15+
locale: US
16+
gosec:
17+
severity: low
18+
exclusions:
19+
generated: lax
20+
paths:
21+
- third_party$
22+
- builtin$
23+
- examples$
24+
issues:
25+
max-issues-per-linter: 0
26+
max-same-issues: 0
27+
fix: true
28+
formatters:
29+
enable:
30+
- goimports
31+
settings:
32+
goimports:
33+
local-prefixes:
34+
- "github.com/selesy/deterministic"
35+
exclusions:
36+
generated: lax
37+
paths:
38+
- third_party$
39+
- builtin$
40+
- examples$

.gremlins.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
silent: false
3+
unleash:
4+
integration: false
5+
dry-run: false
6+
tags: ""
7+
output: ""
8+
diff: ""
9+
output-statuses: ""
10+
workers: 0
11+
test-cpu: 0
12+
timeout-coefficient: 30 # default 0
13+
threshold:
14+
efficacy: 99.99999999999999 # default 0
15+
mutant-coverage: 0
16+
exclude-files: []
17+
18+
mutants:
19+
arithmetic-base:
20+
enabled: true
21+
conditionals-boundary:
22+
enabled: true
23+
conditionals-negation:
24+
enabled: true
25+
increment-decrement:
26+
enabled: true
27+
invert-assignments:
28+
enabled: true # default false
29+
invert-bitwise:
30+
enabled: true # default false
31+
invert-bwassign:
32+
enabled: true # default false
33+
invert-negatives:
34+
enabled: true
35+
invert-logical:
36+
enabled: true # default false
37+
invert-loopctrl:
38+
enabled: true # default false
39+
remove-self-assignments:
40+
enabled: true # default false

.pre-commit-config.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: mixed-line-ending
10+
- id: check-json
11+
# exclude: internal/agi/testdata/errors_on_unmarshal_with_invalid_json/.config.json
12+
- id: check-yaml
13+
- id: check-added-large-files
14+
# - id: detect-aws-credentials
15+
- id: detect-private-key
16+
- id: mixed-line-ending
17+
- repo: https://github.com/codespell-project/codespell
18+
rev: v2.4.1
19+
hooks:
20+
- id: codespell
21+
- repo: https://github.com/TekWizely/pre-commit-golang
22+
rev: v1.0.0-rc.1
23+
hooks:
24+
- id: go-mod-tidy
25+
args: ["--hook:env:GOPRIVATE=github.com/DIN-center"]
26+
- id: my-cmd-repo
27+
alias: go-generate
28+
name: go-generate
29+
args: ["go", "generate", "./..."]
30+
- id: go-test-mod
31+
- id: golangci-lint-mod
32+
- id: my-cmd-repo
33+
alias: gremlins
34+
name: gremlins
35+
args: ["bash", "-c", "go tool gremlins unleash"]
36+
- id: my-cmd-repo
37+
alias: govulncheck
38+
name: govulncheck
39+
args: ["bash", "-c", "go tool govulncheck ./..."]
40+
# - id: my-cmd-repo
41+
# alias: lichen-build
42+
# name: lichen-build
43+
# args: ["bash", "-c", "go build -o ./bin/ax-lichen ."]
44+
# - id: my-cmd-repo
45+
# alias: lichen-check
46+
# name: lichen-check
47+
# args: ["bash", "-c", "go tool lichen ./bin/ax-lichen"]
48+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
49+
rev: v9.22.0
50+
hooks:
51+
- id: commitlint
52+
stages: [commit-msg]
53+
additional_dependencies: ['@commitlint/config-conventional']
54+
- repo: https://github.com/trufflesecurity/trufflehog
55+
rev: v3.88.21
56+
hooks:
57+
- id: trufflehog
58+
alias: trufflehog
59+
name: trufflehog

.release-please-config.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "go", # Ensure this matches your workflow's release-type
4+
"changelog-sections": [
5+
{
6+
"type": "feat",
7+
"section": "🚀 Features",
8+
"hidden": false
9+
},
10+
{
11+
"type": "fix",
12+
"section": "🐛 Bug Fixes",
13+
"hidden": false
14+
},
15+
{
16+
"type": "perf",
17+
"section": "⚡ Performance Improvements",
18+
"hidden": false
19+
},
20+
{
21+
"type": "docs",
22+
"section": "📝 Documentation",
23+
"hidden": false
24+
},
25+
{
26+
"type": "chore",
27+
"section": "Other",
28+
"hidden": false
29+
},
30+
{
31+
"type": "style",
32+
"section": "Other",
33+
"hidden": false
34+
},
35+
{
36+
"type": "refactor",
37+
"section": "Other",
38+
"hidden": false
39+
},
40+
{
41+
"type": "test",
42+
"section": "Other",
43+
"hidden": false
44+
},
45+
{
46+
"type": "build",
47+
"section": "Other",
48+
"hidden": false
49+
},
50+
{
51+
"type": "ci",
52+
"section": "Other",
53+
"hidden": false
54+
},
55+
{
56+
"type": "revert",
57+
"section": "Other",
58+
"hidden": false
59+
}
60+
],
61+
"conventional-changelog-core": {
62+
"types": [
63+
{ "type": "feat", "section": "🚀 Features", "hidden": false },
64+
{ "type": "fix", "section": "🐛 Bug Fixes", "hidden": false },
65+
{ "type": "perf", "section": "⚡ Performance Improvements", "hidden": false },
66+
{ "type": "docs", "section": "📝 Documentation", "hidden": false },
67+
{ "type": "chore", "section": "Other", "hidden": false },
68+
{ "type": "style", "section": "Other", "hidden": false },
69+
{ "type": "refactor", "section": "Other", "hidden": false },
70+
{ "type": "test", "section": "Other", "hidden": false },
71+
{ "type": "build", "section": "Other", "hidden": false },
72+
{ "type": "ci", "section": "Other", "hidden": false },
73+
{ "type": "revert", "section": "Other", "hidden": false }
74+
]
75+
}
76+
}

.tool-versions

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
direnv 2.37.1
2+
golang 1.25.8
3+
golangci-lint 2.6.0
4+
mage 1.15.0
5+
pre-commit 4.2.0
6+
python 3.10.4

0 commit comments

Comments
 (0)