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

Fix non-functional linting warnings #183

Conversation

gatici
Copy link
Contributor

@gatici gatici commented Nov 8, 2023

Fixing whitespace and import order warnings by running following command. This PR does not affect the code functionality.

golangci-lint run --fix

@onf-bot
Copy link
Contributor

onf-bot commented Nov 8, 2023

Can one of the admins verify this patch?

1 similar comment
@onf-bot
Copy link
Contributor

onf-bot commented Nov 8, 2023

Can one of the admins verify this patch?

@gab-arrobo
Copy link
Contributor

retest this please

@thakurajayL
Copy link
Contributor

Do you need this to be reviewed ?

@gab-arrobo
Copy link
Contributor

test this please

@gab-arrobo
Copy link
Contributor

retest this please

@gab-arrobo
Copy link
Contributor

gab-arrobo commented Nov 25, 2023

@gatici, I know why the pull_request fails and you have a PR that addresses the unit-test-pfcpiface (#180), but I was expecting this PR to pass the golangci-lint test/GHA. Am I overlooking something?

context/sm_context.go Outdated Show resolved Hide resolved
context/sm_context.go Outdated Show resolved Hide resolved
@gab-arrobo
Copy link
Contributor

gab-arrobo commented Nov 29, 2023

@gatici, I know why the pull_request fails and you have a PR that addresses the unit-test-pfcpiface (#180), but I was expecting this PR to pass the golangci-lint test/GHA. Am I overlooking something?

@gatici, please double check this PR because it looks like golangci-lint run --fix did not properly fix linting warnings and actually added more issues. For example, in context/sm_contest.go, imports are now duplicated as shown below:

	"net"
	"net/http"
	"net"
	"net/http"

I am making a couple modifications to see if the issue can be directly addressed from the PR

Remove entry that was added
Remove entry that was added
@gab-arrobo
Copy link
Contributor

test this please

@@ -187,8 +186,8 @@ func getSvcMsgType(nfType models.NfType) svcmsgtypes.SmfMsgType {
}

func SendNrfForNfInstance(nrfUri string, targetNfType, requestNfType models.NfType,
param *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (models.SearchResult, error) {

param *Nnrf_NFDiscovery.SearchNFInstancesParamOpts,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this comma , added in here?

@gab-arrobo
Copy link
Contributor

gab-arrobo commented Nov 29, 2023

Fixing whitespace and import order warnings by running following command. This PR does not affect the code functionality.

golangci-lint run --fix

@gatici, how did you install golangci-lint? I installed it through snap and from go but I cannot replicate your PR by running golangci-lint run --fix through any of these two options.

@gatici
Copy link
Contributor Author

gatici commented Dec 1, 2023

golangci-lint

Hi @gab-arrobo
I installed it through the link by getting the binary, then run the command golangci-lint run --fix.

@gab-arrobo
Copy link
Contributor

golangci-lint

Hi @gab-arrobo I installed it through the link by getting the binary, then run the command golangci-lint run --fix.

Hi @gatici, thanks for the link. Based on what I am reading, golangci-lint is the same as this golangci-lint-action GHA, which is the recommended option for CI/CD projects as indicated here. So, I am running the GitHub Action but it does not make any fixes/changes to the files. Would it be that your PR includes lots of changes because the way you are running the command (golangci-lint run --fix) and this does not take into account the options provided in .golangci.yml.

Moreover, when downloading the binary from the link you provided, I still cannot replicate your PR. Here are the steps I followed:

$ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
$ golangci-lint --version
golangci-lint has version 1.55.2 built with go1.21.3 from e3c2265f on 2023-11-03T12:59:25Z
$ cd smf/
$ golangci-lint run --fix
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

@gatici
Copy link
Contributor Author

gatici commented Dec 4, 2023

Hello @gab-arrobo

After rebasing on master, I can not reproduce it. The reason is https://github.com/omec-project/smf/pull/182/files# is disabled all the linters in .golangci.yml. After merging PR 182, this PR become invalid. I will close it at the moment.

@gatici gatici closed this Dec 4, 2023
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.

4 participants