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

Support running controversial/experimental rules individually #251

Open
maxbrunet opened this issue Oct 31, 2022 · 1 comment
Open

Support running controversial/experimental rules individually #251

maxbrunet opened this issue Oct 31, 2022 · 1 comment

Comments

@maxbrunet
Copy link

Certain rules are preferred to be excluded from the global formatting, but it can be interesting to suggest them as individual quick fixes. Providing an API to run them individually would allow the creation of specific code actions in gopls (golang/go#56403)

There are at least 2 potential candidates at the moment:

gofumpt/format/format.go

Lines 645 to 648 in 70d7433

// Merging adjacent fields (e.g. parameters) is disabled by default.
if !f.ExtraRules {
break
}

gofumpt/format/format.go

Lines 755 to 759 in 70d7433

if os.Getenv("GOFUMPT_SPLIT_LONG_LINES") != "on" {
// By default, this feature is turned off.
// Turn it on by setting GOFUMPT_SPLIT_LONG_LINES=on.
return
}

@mvdan
Copy link
Owner

mvdan commented Nov 18, 2022

Worth noting that #78 is related, but here we just need the "extra" rule to be an analysis. The regular formatting could stay the same.

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

No branches or pull requests

2 participants