-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(formatting): fix infected files with correct formatting #5099
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
chore(formatting): fix infected files with correct formatting #5099
Conversation
Signed-off-by: ivan katliarchuk <[email protected]>
|
Linter fix is here #5085 example fix linters-settings:
# Remove or correct the 'maligned' property
goimports:
local-prefixes: github.com/kubernetes-sigs/external-dns
run:
# Remove or correct the 'exclude-files' property
skip-dirs:
- vendor
- internal |
Signed-off-by: ivan katliarchuk <[email protected]>
|
/label tide/merge-method-squash |
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| # https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#verify |
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.
Wdyt about adding verify: true in current golangci lint action instead of creating a new one ?
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.
Changed. First impression was, that it does not support both operation, but looks like it does. Validated here https://github.com/golangci/golangci-lint-action/blob/3b4f037d0e94e85d98f9824ef87b2dc32d53fbd5/src/run.ts#L140
| # https://github.com/editorconfig/editorconfig-core-go/blob/master/.editorconfig | ||
| [{Makefile,go.mod,go.sum,*.go,.gitmodules}] | ||
| indent_style = tab | ||
| indent_size = 4 |
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.
Current indent_size on all go files in master is 2.
Why would we want to change it to 4 ? It would force to update all codebase and force all PRs to rebase.
side note: there are no gitmodules in this project
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.
Removed submodules.
I've added gofmt -l -s -w . to go-lint docs https://pkg.go.dev/cmd/gofmt
I only found this few files that

have issues with intendations, rest of them are fine
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.
Shell we add gofmt validation to github actions?
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.
Some inspirations from kubernetes-sigs https://github.com/search?q=org%3Akubernetes-sigs+gofmt&type=code&p=3
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.
Current
indent_sizeon all go files in master is 2. Why would we want to change it to 4 ? It would force to update all codebase and force all PRs to rebase.side note: there are no gitmodules in this project
Golang is 4 tabs intendation, which is set across the project.
The proper Go style way to do this is to configure your editor's display of tabs instead.
Is it shows 2 spaces in your editor?
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.
When I checked yesterday, it was displaying 2 spaces.
Today, it display 4 spaces, as you say 😅 .
Shall we add gofmt validation to github actions?
Yes, it sounds good 👍 .
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.
Gofmt github action step in action https://github.com/kubernetes-sigs/external-dns/actions/runs/13366428004/job/37325125200?pr=5099
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.
Nice !
Signed-off-by: ivan katliarchuk <[email protected]>
Signed-off-by: ivan katliarchuk <[email protected]>
Signed-off-by: ivan katliarchuk <[email protected]>
|
@ivankatliarchuk You'll need to fix the config of golangci-lint and we should be good to go. |
Signed-off-by: ivan katliarchuk <[email protected]>
Signed-off-by: ivan katliarchuk <[email protected]>
|
Fixed |
mloiseleur
left a comment
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.
LGTM
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mloiseleur The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* master: (97 commits) chore(formatting): fix infected files with correct formatting (kubernetes-sigs#5099) docs: Fix managed-record-type argument docs(proposal): support multiple replicas with leader election (kubernetes-sigs#5051) feat(chart): automate helm json schema (kubernetes-sigs#5075) docs(proposal): update proposal template, add statuses test(aws): introduce first fixture-based (kubernetes-sigs#5092) chore(makefile): add helper and document targets feat: Updated chart for v1.15.2 release chore(makefile): add helper and document targets chore(filter-tags): pre-process filter tags chore(filter-tags): pre-process filter tags chore(filter-tags): pre-process filter tags chore(deps): bump the dev-dependencies group across 1 directory with 21 updates test(domain-filter): simple filters on domain exclusion (kubernetes-sigs#5064) chore(deps): bump nosborn/github-action-markdown-cli ci(docs): add markdown linters and editorconfig (kubernetes-sigs#5055) Address PR comments docs: update and refactor contribution part (kubernetes-sigs#5073) fix(chart): update rbac for F5 transportserver source (kubernetes-sigs#5066) fix(chart): non-string types on svcaccount annotations (kubernetes-sigs#5067) ...
* master: (31 commits) fix(source): debug log on gateway target detection Update docs/sources/service.md chore(formatting): fix infected files with correct formatting (kubernetes-sigs#5099) docs: Fix managed-record-type argument Update docs/sources/service.md docs(proposal): support multiple replicas with leader election (kubernetes-sigs#5051) fixed golangci-lint config updated MD files updated MD files feat(chart): automate helm json schema (kubernetes-sigs#5075) docs(proposal): update proposal template, add statuses test(aws): introduce first fixture-based (kubernetes-sigs#5092) chore(makefile): add helper and document targets feat: Updated chart for v1.15.2 release chore(makefile): add helper and document targets chore(filter-tags): pre-process filter tags chore(filter-tags): pre-process filter tags chore(filter-tags): pre-process filter tags chore(deps): bump the dev-dependencies group across 1 directory with 21 updates update service.md, service.go ...
* master: (80 commits) chore(deps): bump the dev-dependencies group across 1 directory with 7 updates Update README.md with proper link to dev guide Add OpenStack Designate webook provider to readme chore(deps): bump the dev-dependencies group with 3 updates chore(deps): bump the dev-dependencies group with 20 updates chore(deps): bump azure/setup-helm in the dev-dependencies group style: formatting fix: remove broken test fix test name chore: upgrade ExternalDNS to go 1.24 chore-makefile-coverage cover source.go getProviderSpecificAnnotations() with unit tests nitpick: rename cloudflare custom hostname test function review suggestions based improvements review suggestions fix(source): debug log on gateway target detection improve error message phrasing Update docs/sources/service.md chore(formatting): fix infected files with correct formatting (kubernetes-sigs#5099) docs: Fix managed-record-type argument ...

Description
Found the issue in this pull request https://github.com/kubernetes-sigs/external-dns/pull/5097/files#r1957067735
Checklist