Skip to content
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 format command on Makefile #7437

Merged
merged 1 commit into from Jun 1, 2023

Conversation

osodracnai
Copy link
Contributor

@osodracnai osodracnai commented May 5, 2023

This commit adds the format command to make it easier to be compliant to golangci-lint issues

Proposed Changes

This commit adds the format command to make it easier to be compliant to golangci-lint issues.

I would prefer to use the flag -local for goimports that will segregate imports by:

import(
native-go-dependence

external-dependece

our-project-dependence
)

will look something like this:

import (
	"context"
	"errors"
	"os"

	"github.com/sirupsen/logrus"
	"github.com/urfave/cli"

	"github.com/k3s-io/k3s/pkg/cli/agent"
	"github.com/k3s-io/k3s/pkg/cli/cert"
)

but by applying this almost all files will be affected, so maybe apply this change and then another to improve.

Types of Changes

New feature

Verification

make format

Testing

Linked Issues

User-Facing Change

NONE

Further Comments

@osodracnai osodracnai requested a review from a team as a code owner May 5, 2023 12:14
Makefile Outdated Show resolved Hide resolved
Makefile Outdated
@@ -1,4 +1,6 @@
TARGETS := $(shell ls scripts | grep -v \\.sh)
GO_FILES ?= $$(find . -name '*.go' | grep -v vendor | grep -v generated)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we don't have a vendor folder for k3s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if someone use make deps it generates one

@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Patch coverage has no change and project coverage change: +28.16 🎉

Comparison is base (eb83af0) 19.45% compared to head (abde5fe) 47.61%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #7437       +/-   ##
===========================================
+ Coverage   19.45%   47.61%   +28.16%     
===========================================
  Files          81      140       +59     
  Lines        5495    14323     +8828     
===========================================
+ Hits         1069     6820     +5751     
- Misses       4204     6421     +2217     
- Partials      222     1082      +860     
Flag Coverage Δ
inttests 44.97% <ø> (?)
unittests 19.85% <ø> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 140 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

This commit adds the format command to make it easier to be compliant to golangci-lint issues

Signed-off-by: Ian Cardoso <osodracnai@gmail.com>
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.

None yet

4 participants