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

Exposed modules-download-mode as a command line option #781

Merged
merged 4 commits into from Oct 14, 2019
Merged

Exposed modules-download-mode as a command line option #781

merged 4 commits into from Oct 14, 2019

Conversation

pstibrany
Copy link
Contributor

This tiny change exposes modules-download-mode as a command line option, allowing us to easily control it from Makefile.

@CLAassistant
Copy link

CLAassistant commented Oct 4, 2019

CLA assistant check
All committers have signed the CLA.

pkg/commands/run.go Outdated Show resolved Hide resolved
@jirfag
Copy link
Member

jirfag commented Oct 4, 2019

Hi, why do you need to control it from Makefile?

@pstibrany
Copy link
Contributor Author

pstibrany commented Oct 4, 2019 via email

@tpounds
Copy link
Contributor

tpounds commented Oct 4, 2019

@pstibrany, @jirfag Does it make sense to just have golangci-lint use the same flags and resolution strategy as the Go tool chain -mod options? That is, users can specify -mod=X on the golangci-lint command line or set the value via GOFLAGS environment variable?

@tpounds tpounds added area: config Related to .golangci.yml and/or cli options enhancement New feature or improvement labels Oct 4, 2019
@pstibrany
Copy link
Contributor Author

It seems to me that all golang-cli does is to pass the configured value to -mod parameter when running go tools. I'm fine with renaming the parameter to -mod. I have tried to use GOFLAGS, but that didn't work, and exposing the parameter seemed like smaller change than making GOFLAGS work :)

@jirfag
Copy link
Member

jirfag commented Oct 8, 2019

  1. Naming inside .golangci.yml should be the same as in command-line
  2. If we name it mod in .golangci.yml it will look too unclear.
  3. I think it's also unclear for a lot of people even in the command-line. I would prefer clarity over uniformity

@jimen0
Copy link
Contributor

jimen0 commented Oct 8, 2019

What about -mod-mode? I too want this feature to be added 🎉

@jirfag
Copy link
Member

jirfag commented Oct 8, 2019

I like your ‘modules-download-mode’

@pstibrany
Copy link
Contributor Author

I don't mind using either, it's just a name. More important to me is whether I can quickly find out what it does. "-mod" would be more familiar to people since it's the same as used by Go, "-modules-download-mode" is consistent with .golangci.yml. But grepping golangci-lint -help for -mod already shows this option.

I was wondering more about passing GOFLAGS env when calling go tools. Do you want to do that as part of this PR?

@jirfag jirfag merged commit d47b6f5 into golangci:master Oct 14, 2019
@pstibrany pstibrany deleted the module-download-option branch October 20, 2019 14:14
@ldez ldez added this to the v1.21 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Related to .golangci.yml and/or cli options enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants