-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2114 from JoelSpeed/introduce-kal
Introduce KAL (Kube-API-Linter) to API repo
- Loading branch information
Showing
2,757 changed files
with
408,820 additions
and
14,985 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,16 @@ | ||
linters-settings: | ||
custom: | ||
kal: | ||
type: "module" | ||
description: KAL is the Kube-API-Linter and lints Kube like APIs based on API conventions and best practices. | ||
settings: | ||
linters: {} | ||
linters: | ||
disable-all: true | ||
enable: | ||
- kal | ||
issues: | ||
# We have a lot of existing issues. | ||
# Want to make sure that those adding new fields have an | ||
# opportunity to fix them when running the linter locally. | ||
max-issues-per-linter: 1000 |
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,6 @@ | ||
{ | ||
"go.lintTool": "golangci-lint", | ||
"go.alternateTools": { | ||
"golangci-lint": "${workspaceFolder}/hack/golangci-lint.sh", | ||
} | ||
} |
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,18 @@ | ||
#!/bin/bash | ||
|
||
source "$(dirname "${BASH_SOURCE}")/lib/init.sh" | ||
|
||
# Build codegen-crds when it's not present and not overriden for a specific file. | ||
if [ -z "${GOLANGCI_LINT:-}" ];then | ||
${TOOLS_MAKE} golangci-kal | ||
GOLANGCI_LINT="${TOOLS_OUTPUT}/golangci-kal" | ||
fi | ||
|
||
# In CI, HOME is set to / and is not writable. | ||
# Make sure golangci-lint can create its cache. | ||
HOME=${HOME:-"/tmp"} | ||
if [[ ${HOME} == "/" ]]; then | ||
HOME="/tmp" | ||
fi | ||
|
||
"${GOLANGCI_LINT}" $@ |
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,11 @@ | ||
#!/bin/bash | ||
|
||
source "$(dirname "${BASH_SOURCE}")/lib/init.sh" | ||
|
||
# Build codegen-crds when it's not present and not overriden for a specific file. | ||
if [ -z "${KAL:-}" ];then | ||
${TOOLS_MAKE} kal | ||
KAL="${TOOLS_OUTPUT}/kal" | ||
fi | ||
|
||
"${KAL}" -fix ./... |
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,6 @@ | ||
version: v1.62.0 | ||
name: golangci-kal | ||
destination: ./bin | ||
plugins: | ||
- module: 'github.com/JoelSpeed/kal' | ||
version: v0.0.0-20241203114946-bdb342a271f6 |
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.