Go: improve output of check formatting in makefile#14364
Go: improve output of check formatting in makefile#14364owen-mc merged 4 commits intogithub:mainfrom
Conversation
|
Accidentally based on another PR? |
487c520 to
186146a
Compare
|
@smowton Deliberately, to check what is printed when there are mis-formatted files. Hence why it's still a draft. |
|
The output when based on a PR with files that need to be reformatted is like this (taken from CI): It would be slightly nicer if they weren't all on one line, but I think this is acceptable. When there is also a file that can't be parsed then the error is included in the list, like this (taken from my local machine): Again, I think this is confusing but acceptable. |
The list of files that would change when reformatted is now printed. Also, parsing errors now make the check fail.
186146a to
5433636
Compare
|
@smowton I've rebased on |
smowton
left a comment
There was a problem hiding this comment.
Not familiar with an @ variable, but I'll take your word for it that this does what it ought to.
I don't think go files serving as qhelp examples should gain package declarations and imports; it's better that they are abbreviated snippets.
|
I don't know what the
Not sure if we want that, actually. |
I think that should be dealt with separately. All but four qhelp examples already have package declarations and imports, so I think it's fine for this PR to fix the four that don't. |
|
With Copilot's help again I have figured out how to preserve the line breaks when printing the output of gofmt, so the list of files that need to be reformatted is now more readable. I believe it will look like this: |
smowton
left a comment
There was a problem hiding this comment.
Change message to note that a file can be flagged due to compile errors as well as due to formatting problems; otherwise lgtm
I tried to do this once before but my bash-scripting skills weren't up to it. This time I had copilot to do it for me 😄 .