Skip to content

Conversation

@mariusvniekerk
Copy link

Funcorder is a pretty awesome linting tool for golang. I like a lot of what it does and took a stab at implementing functionality to allow it to automatically reformat the code to match the rules requested.

This gated behind an autofix option with several tests ensuring it correctly does the work desired.

@manuelarte
Copy link
Owner

manuelarte commented Nov 18, 2025

Hi @mariusvniekerk, thanks a lot for your comments and for creating this PR! I really appreciate contributions like yours.

I haven’t had time to review the draft yet (I have been a bit busy at work), but I’m looking forward to seeing your design and approach for the fix flag.

For context, there were previous attempts to implement the fix option (#37 ), but @ldez and I decided not to proceed at that time. We were concerned with the fact of potentially reordering large portions of the code and other details, such as adding all the suggested fixes inside one single diagnostic.

@mariusvniekerk
Copy link
Author

mariusvniekerk commented Nov 18, 2025

We almost certainly do not want to make this the default behavior likely ever, due to as you say this making a very large change in almost every codebase where this is run.

Thats mostly why i had by version rely on a configuration value rather than making use of the --fix flag.

Generally this kind of wholesale code reformatting is best done once (and then generally a git blame ignore file)

@sonarqubecloud

This comment was marked as off-topic.

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