Closed andrew-field closed 1 month ago
Hi @andrew-field, thanks for reporting this issue and for providing such a detailed report.
Let me try reproducing this in a test in order to understand what's happening.
I provided a link to my test repo, which might help.
Yes, this is helpful. Thanks @andrew-field !
And, to answer your questions:
Why are the names of all the go files given as arguments?
Because the GO
"language" expects to lint individual Go files.
Could we change the command to run the linter to:
golangci-lint run ./... -c /action/lib/.automation/.golangci.yml --fast
or even more succinctly,golangci-lint run -c /action/lib/.automation/.golangci.yml --fast
, which I believe does the same thing of linting all the files, without passing all the files as arguments and without the error? If not changing the command as above, could this be configured somehow/an option for the super linter to run the golangci-lint linter in this way?
This is already implemented using the GO_MODULES
"language".
Can you try adding VALIDATE_GO: false
in your configuration?
It should only run GO_MODULES
linting which does what you ask.
Ah yes, I see. Thanks very much. Indeed, the debug log shows the command is running the golangci-lint program without the individual files for the Go_Modules lint. Reading the description for the variable VALIDATE_GO seems quite clear now...not sure where I misunderstood in the first place... Might I humbly suggest though that the default value for VALIDATE_GO is changed to false? It says VALIDATE_GO should be set to false if VALIDATE_GO_MODULES is true but they are both set to true by default at the moment.
Thanks for getting back with this update :)
VALIDATE_xxx
variables are all true
by default, so that would require a breaking change. :(
Closing because we understood what this is about here.
Is there an existing issue for this?
Are you using the latest Super-linter version available?
[X] I am using the latest Super-linter version.
[X] I can reproduce the issue running Super-linter using complete version identifier (example: vX.Y.Z), and not just with a partial one (example: vX)
[X] I am using the super-linter/super-linter action or container image, and not the deprecated github/super-linter action or container image.
Are you resonably sure that it's a Super-linter issue, and not an issue related to a tool that Super-linter runs?
Current Behavior
I run the super linter through a github action for a very simple go repository with two folders and a go file in each, to lint the files. The super linter uses the golangci-lint linter. The action fails and the go linter is given as the error. The output is:
Expected Behavior
The action passes and no error is given. When running the golangci-lint linter directly using any of the following commands, the linter produces no errors, therefore the super linter should produce no errors.
I have tested this with the latest golangci-lint version 1.61 and also 1.60.3, the current version of golangci-lint used by the super linter. The golangci.yml configuration file used in the commands above is the same configuration file found in the TEMPLATES folder of the super linter.
Super-Linter version
Super-linter configuration
Relevant log output
Steps To Reproduce
Run the super linter for any go repository with more than two folders and go files.
Anything else?
My repository shows the problem: https://github.com/andrew-field/InvestigateSuperLinterBug https://github.com/andrew-field/InvestigateSuperLinterBug/actions
As can be seen from the logs, the problem is caused by running the golangci-lint linter with the following command.
golangci-lint run -c /action/lib/.automation/.golangci.yml --fast /github/workspace/folder1/multiply.go /github/workspace/folder2/add.go
, where each file is named and given as an argument.I guess my main questions are:
golangci-lint run ./... -c /action/lib/.automation/.golangci.yml --fast
or even more succinctly,golangci-lint run -c /action/lib/.automation/.golangci.yml --fast
, which I believe does the same thing of linting all the files, without passing all the files as arguments and without the error?