-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add YAML linting for golangci-lint config files #661
Comments
https://github.com/adrienverge/yamllint seems like it might do the job. A recent enough version is available for installation via |
$ docker run -it --rm -v $PWD:$PWD -w $PWD ghcr.io/atc0005/go-ci:go-ci-stable
root@a5d5a7803615:/home/ubuntu/Desktop/go-ci# ls -la
total 116
drwxrwxr-x 8 1000 1000 4096 Jun 19 13:48 .
drwxr-xr-x 3 root root 4096 Jun 20 10:22 ..
drwxrwxr-x 8 1000 1000 4096 Jun 20 10:11 .git
drwxrwxr-x 3 1000 1000 4096 Apr 25 10:07 .github
-rw-rw-r-- 1 1000 1000 446 Nov 29 2020 .gitignore
-rw-rw-r-- 1 1000 1000 676 Jun 19 12:46 .markdownlint.yml
-rw-rw-r-- 1 1000 1000 41928 Jun 2 11:48 CHANGELOG.md
-rw-rw-r-- 1 1000 1000 1070 Jul 30 2020 LICENSE
-rw-rw-r-- 1 1000 1000 17950 Jun 19 13:48 Makefile
-rw-rw-r-- 1 1000 1000 7892 Jun 19 13:48 README.md
drwxrwxr-x 2 1000 1000 4096 Jun 20 10:18 oldstable
drwxrwxr-x 5 1000 1000 4096 Jun 20 10:03 stable
drwxrwxr-x 2 1000 1000 4096 Jun 19 13:48 tools
drwxrwxr-x 2 1000 1000 4096 Jun 20 10:18 unstable
root@a5d5a7803615:/home/ubuntu/Desktop/go-ci# yamllint ./.markdownlint.yml
./.markdownlint.yml
13:1 warning missing document start "---" (document-start)
root@a5d5a7803615:/home/ubuntu/Desktop/go-ci# echo $?
0
root@a5d5a7803615:/home/ubuntu/Desktop/go-ci# yamllint ./stable/.golangci.yml
./stable/.golangci.yml
15:1 warning missing document start "---" (document-start)
28:81 error line too long (103 > 80 characters) (line-length)
86:81 error line too long (82 > 80 characters) (line-length)
87:81 error line too long (82 > 80 characters) (line-length)
root@a5d5a7803615:/home/ubuntu/Desktop/go-ci# echo $?
1
root@a5d5a7803615:/home/ubuntu/Desktop/go-ci# yamllint ./stable/.golangci.yml
./stable/.golangci.yml
15:1 warning missing document start "---" (document-start)
28:81 error line too long (103 > 80 characters) (line-length)
root@a5d5a7803615:/home/ubuntu/Desktop/go-ci# yamllint ./stable/.golangci.yml
./stable/.golangci.yml
15:1 warning missing document start "---" (document-start) This is from a local build of what will be the v0.6.14 version of the The errors were resolved by fixing the line length: diff --git a/stable/.golangci.yml b/stable/.golangci.yml
index 6c3a6b0..ab5ece2 100644
--- a/stable/.golangci.yml
+++ b/stable/.golangci.yml
@@ -25,7 +25,10 @@ issues:
run:
# Define the Go version limit.
# Mainly related to generics support in go1.18.
- # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17
+ #
+ # Default: use Go version from the go.mod file, fallback on the env var
+ # `GOVERSION`, fallback on 1.17
+ #
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
go: "1.18"
@@ -83,9 +86,9 @@ linters-settings:
enable-all: true
disable:
#
- # Disable fieldalignment settings until the Go team offers more control over
- # the types of checks provided by the fieldalignment linter or golangci-lint
- # does so.
+ # Disable fieldalignment settings until the Go team offers more control
+ # over the types of checks provided by the fieldalignment linter or
+ # golangci-lint does so.
#
# See https://github.com/atc0005/go-ci/issues/302 for more information.
#
|
FWIW, run:
go: 1.18 whereas the https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml VSCode extension does: |
The https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml extension might be a resource that can be leveraged here.
The text was updated successfully, but these errors were encountered: