-
Notifications
You must be signed in to change notification settings - Fork 84
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
Added yamllint, fixed current linting errors, added github action #1727 #2013
base: main
Are you sure you want to change the base?
Added yamllint, fixed current linting errors, added github action #1727 #2013
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: priyanshikhetwani The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @priyanshikhetwani! |
Hi @priyanshikhetwani. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @priyanshikhetwani!
Did you happen to verify the workflow against your fork? It'll be helpful if you could share a sample run here.
Added the same |
@priyanshikhetwani please squash the commits. |
/ok-to-test |
dd6d283
to
ba92cd7
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@priyanshikhetwani, when I run this locally, see quite a lot of errors regarding trailing spaces, can you please cross check?
./templates/cluster-template-powervs-clusterclass/cluster-with-kcp.yaml
56:21 error too many spaces after colon (colons)
61:21 error too many spaces after colon (colons)
169:1 error trailing spaces (trailing-spaces)
183:1 error trailing spaces (trailing-spaces)
185:1 error trailing spaces (trailing-spaces)
188:1 error trailing spaces (trailing-spaces)
194:1 error trailing spaces (trailing-spaces)
196:1 error trailing spaces (trailing-spaces)
201:1 error trailing spaces (trailing-spaces)
206:1 error trailing spaces (trailing-spaces)
./templates/bases/powervs/kcp.yaml
125:1 error trailing spaces (trailing-spaces)
139:1 error trailing spaces (trailing-spaces)
141:1 error trailing spaces (trailing-spaces)
144:1 error trailing spaces (trailing-spaces)
150:1 error trailing spaces (trailing-spaces)
152:1 error trailing spaces (trailing-spaces)
157:1 error trailing spaces (trailing-spaces)
162:1 error trailing spaces (trailing-spaces)
./templates/bases/vpc/kcp.yaml
29:26 error trailing spaces (trailing-spaces)
36:26 error trailing spaces (trailing-spaces)
./templates/cluster-template-vpc-clusterclass/cluster-with-kcp.yaml
107:30 error trailing spaces (trailing-spaces)
114:30 error trailing spaces (trailing-spaces)
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makefile
Outdated
@@ -546,6 +546,24 @@ else | |||
echo "Versions are different across Makefiles. Please ensure to keep them uniform." | |||
endif | |||
|
|||
|
|||
.PHONY: install-yamllint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The installation way needs to change. refer - https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/hack/tools/Makefile#L59-L61
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also I am wondering if we should explore on reliability of yamllint source.
For ref kubebuilder - https://github.com/kubernetes-sigs/kubebuilder/blob/master/.github/workflows/lint.yml#L29-L34
For ref test-infra - https://github.com/kubernetes/test-infra/blob/master/hack/make-rules/verify/yamllint.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @Prajyot-Parab, wasilibs/go-yamllint looks like it is recently developed, not sure how well it will be maintained going further. Do we want to explore with another reliable source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Amulyam24 IMO yes we should try out something more stable/matured source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@priyanshikhetwani, initially adrienverge/yamllint was being considered, were there any challenges with it which made you switch to go-yamllint ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Amulyam24 @Prajyot-Parab I primarily switched because adrienverge/yamllint requires Python and pip.
I am exploring other better/mature options as well.
run: make install-yamllint | ||
|
||
- name: Run yamllint | ||
run: make lint-yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run: make lint-yaml | |
run: make lint-yaml | |
@priyanshikhetwani, any update? |
fdceef1
to
14959ec
Compare
@priyanshikhetwani: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Hi, Thanks for the work on this, I believe still some work is left here, So lets not hurry as it involves configuration yaml files. We have decided to take this for next release. |
@priyanshikhetwani what else should we need on this PR |
Hi @Karthik-K-N , ideally, we wanted a go based yaml linting tool that was well maintained. |
What this PR does / why we need it: Enhance linting to cover yaml files (to avoid issues as - 7cd7fcc)
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1497
Test Workflow: