Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add make target to format source code#848

Merged
yesnault merged 11 commits intoovh:masterfrom
peczenyj:add-make-option-to-format-source-code
May 5, 2025
Merged

Add make target to format source code#848
yesnault merged 11 commits intoovh:masterfrom
peczenyj:add-make-option-to-format-source-code

Conversation

@peczenyj
Copy link
Contributor

@peczenyj peczenyj commented May 4, 2025

I add an optional make target fmt that runs gofmt, gofumpt and goimports

this helps to ensure a minimal code standard

I split each run in a separated commit

also I fix one go vet issue on two cmd.Exit calls

peczenyj added 7 commits May 4, 2025 17:54
Signed-off-by: Tiago Peczenyj <[email protected]>
Signed-off-by: Tiago Peczenyj <[email protected]>
Signed-off-by: Tiago Peczenyj <[email protected]>
Signed-off-by: Tiago Peczenyj <[email protected]>
Signed-off-by: Tiago Peczenyj <[email protected]>
Signed-off-by: Tiago Peczenyj <[email protected]>
@peczenyj peczenyj force-pushed the add-make-option-to-format-source-code branch from f44135b to a5162c5 Compare May 4, 2025 15:54
Copy link
Member

@yesnault yesnault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @peczenyj for this suggestion. Can you remove the dependance to mvdan.cc/gofumpt, but keep other updates please? I think that we can stay with gofmt, and we will receive new features as they come in.

@peczenyj
Copy link
Contributor Author

peczenyj commented May 5, 2025

I think that we can stay with gofmt, and we will receive new features as they come in.

Sure @yesnault

BTW If you decided to migrate to golangci lint v2, it also handle formatting using not only gofmt but gofumpt and others, so with one dependency you can do linting and formatting.

and there is a migrate command to help the transition.

@ovh ovh deleted a comment from ovh-cds May 5, 2025
@ovh ovh deleted a comment from ovh-cds May 5, 2025
@ovh ovh deleted a comment from ovh-cds May 5, 2025
@ovh ovh deleted a comment from ovh-cds May 5, 2025
@ovh ovh deleted a comment from ovh-cds May 5, 2025
Copy link
Member

@yesnault yesnault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @peczenyj

@yesnault yesnault merged commit 816296f into ovh:master May 5, 2025
2 checks passed
peczenyj added a commit to peczenyj/venom that referenced this pull request May 7, 2025
* apply go fix ./...

Signed-off-by: Tiago Peczenyj <[email protected]>

* fix go vet -all issue "non-constant format string in call to github.com/ovh/venom/cmd.Exit"

Signed-off-by: Tiago Peczenyj <[email protected]>

* run gofmt -e -l -s -w .

Signed-off-by: Tiago Peczenyj <[email protected]>

* run gofumpt -l -w .

Signed-off-by: Tiago Peczenyj <[email protected]>

* run gofumpt -l -w -extra .

Signed-off-by: Tiago Peczenyj <[email protected]>

* run goimports

Signed-off-by: Tiago Peczenyj <[email protected]>

* add make fmt

Signed-off-by: Tiago Peczenyj <[email protected]>

* Revert "run gofumpt -l -w -extra ."

This reverts commit 8f27a6a.

* remove gofumpt

---------

Signed-off-by: Tiago Peczenyj <[email protected]>
Co-authored-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Tiago Peczenyj <[email protected]>
ceriath pushed a commit to ceriath/venom that referenced this pull request Jul 11, 2025
* apply go fix ./...

Signed-off-by: Tiago Peczenyj <[email protected]>

* fix go vet -all issue "non-constant format string in call to github.com/ovh/venom/cmd.Exit"

Signed-off-by: Tiago Peczenyj <[email protected]>

* run gofmt -e -l -s -w .

Signed-off-by: Tiago Peczenyj <[email protected]>

* run gofumpt -l -w .

Signed-off-by: Tiago Peczenyj <[email protected]>

* run gofumpt -l -w -extra .

Signed-off-by: Tiago Peczenyj <[email protected]>

* run goimports

Signed-off-by: Tiago Peczenyj <[email protected]>

* add make fmt

Signed-off-by: Tiago Peczenyj <[email protected]>

* Revert "run gofumpt -l -w -extra ."

This reverts commit 8f27a6a.

* remove gofumpt

---------

Signed-off-by: Tiago Peczenyj <[email protected]>
Co-authored-by: Yvonnick Esnault <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments