-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update dependencies 1 * fixed a lot of linter issues and added a test * add the linter * new commit * trying to fix the linter * new version * removed the downloaded ci * fixed more linter issues
- Loading branch information
Showing
23 changed files
with
560 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: | ||
- "skip-release-notes" | ||
- "dependencies" | ||
open-pull-requests-limit: 20 # setting a higher number so we can bundle all the weekly updates together | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
labels: | ||
- "skip-release-notes" | ||
- "dependencies" | ||
open-pull-requests-limit: 10 # setting a higher number so we can bundle all the weekly updates together |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Check for diff after manifest and generated targets | ||
|
||
on: | ||
pull_request: {} | ||
|
||
jobs: | ||
diff-check-manifests: | ||
name: Check for diff | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: '${{ github.workspace }}/go.mod' | ||
- name: Restore Go cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: /home/runner/work/_temp/_github_home/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: go mod tidy | ||
run: | | ||
go mod tidy | ||
- name: Check for diff | ||
run: | | ||
git diff --exit-code --shortstat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: test and lint | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'CODE_OF_CONDUCT.md' | ||
- 'README.md' | ||
- 'Contributing.md' | ||
workflow_call: | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
|
||
jobs: | ||
run-test-suite: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: '${{ github.workspace }}/go.mod' | ||
- name: Restore Go cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: /home/runner/work/_temp/_github_home/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run lint | ||
run: make lint | ||
- name: Run tests | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
crd-to-yaml | ||
dist/ | ||
.idea | ||
bin | ||
cty | ||
wasm/wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
run: | ||
go: "1.21" | ||
timeout: 10m | ||
tests: false | ||
allow-parallel-runners: true | ||
issues-exit-code: 2 | ||
skip-dirs: | ||
- "hack" | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
# We are working on it | ||
- wrapcheck | ||
- depguard | ||
# Logical next step | ||
- forcetypeassert # Priority: that can lead to serious crashes. | ||
- exportloopref | ||
- goerr113 # Do not define dynamic errors with Errorf. | ||
- varnamelen # m, d, p < These are not so meaningful variables. | ||
- testpackage # Blackbox testing is preffered. | ||
- funlen # Break long functions. | ||
- gomnd # Give constant values a name with constants. | ||
- ireturn # Accept interface, return concrate. | ||
- nestif # Some nexted if statements are 8 or 9 deep. | ||
- dupl # Check code duplications. | ||
- cyclop # Complex functions are not good. | ||
- gochecknoinits # Init functions cause an import to have side effects, | ||
# and side effects are hard to test, | ||
# reduce readability and increase the complexity of code. | ||
- containedctx # Struct should not contain context, action does. | ||
- nilnil # A function should return either something valuable | ||
# or an error, but both value and error as nil is | ||
# useless. Like when I call it, why is it nil? Tell me | ||
# in an error why. | ||
- bodyclose | ||
- unparam | ||
- nonamedreturns # Either named return, or use simply `return`. | ||
|
||
# Opinionated (we may want to keep it disabled) | ||
- gochecknoglobals | ||
- lll | ||
- paralleltest | ||
- tagliatelle | ||
- wsl | ||
- interfacebloat | ||
|
||
|
||
# Disabled with reason | ||
- dogsled | ||
- exhaustruct # Doesn't really make sense. | ||
- exhaustive # Doesn't really make sense. | ||
- logrlint # Doesn't really make sense. | ||
- goimports # acts weirdly, dci handles imports anyway | ||
|
||
# Disabled because of generics in go 1.18 | ||
- contextcheck | ||
- rowserrcheck | ||
- sqlclosecheck | ||
- wastedassign | ||
|
||
# Deprecated | ||
- deadcode | ||
- exhaustivestruct | ||
- golint | ||
- ifshort | ||
- interfacer | ||
- maligned | ||
- scopelint | ||
- structcheck | ||
- varcheck | ||
- gci | ||
- nosnakecase | ||
|
||
linters-settings: | ||
gci: | ||
sections: | ||
- standard | ||
- blank | ||
- dot | ||
- default | ||
- prefix(github.com/open-component-model/ocm) | ||
custom-order: true | ||
staticcheck: | ||
go: "1.21" | ||
stylecheck: | ||
go: "1.21" | ||
funlen: | ||
lines: 110 | ||
statements: 60 | ||
cyclop: | ||
max-complexity: 45 | ||
skip-tests: true | ||
gocognit: | ||
# Minimal code complexity to report. | ||
# Default: 30 (but we recommend 10-20) | ||
min-complexity: 45 | ||
nolintlint: | ||
allow-unused: false | ||
require-explanation: true | ||
require-specific: false | ||
varnamelen: | ||
ignore-names: | ||
- err | ||
- wg | ||
- id | ||
govet: | ||
check-shadowing: true | ||
lll: | ||
line-length: 120 | ||
gosec: | ||
exclude-generated: true | ||
|
||
issues: | ||
exclude: | ||
- composites | ||
exclude-rules: | ||
- path: cmds/ | ||
linters: | ||
- forbidigo | ||
- text: "should not use dot imports|don't use an underscore in package name" | ||
linters: | ||
- golint | ||
- source: "https://" | ||
linters: | ||
- lll | ||
- text: "shadow: declaration of \"err\"" | ||
linters: | ||
- govet | ||
- text: "shadow: declaration of \"ok\"" | ||
linters: | ||
- govet | ||
- path: _test\.go | ||
linters: | ||
- goerr113 | ||
- gocyclo | ||
- errcheck | ||
- gosec | ||
- dupl | ||
- funlen | ||
- scopelint | ||
- text: "Spec.DeepCopyInto undefined" | ||
linters: | ||
- typecheck | ||
- text: "G601: Implicit memory aliasing in for loop" | ||
# Ignored cos why not, that was the request. | ||
linters: | ||
- gosec | ||
- source: "// .* #\\d+" | ||
linters: | ||
- godox | ||
- path: ignore/.*\.go | ||
linters: | ||
- dupword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.