git-hooks.nix
git-hooks.nix copied to clipboard
Added hooks.golangci-lint.settings.flags option
It is currently not possible to define any of the many golangci-lint flags: https://golangci-lint.run/docs/configuration/cli/#run
This PR adds the option to do so.
Does hooks.golangci-lint.args = [ ... ]; work for this hook?
I don't see where the args would be added to the command:
https://github.com/cachix/git-hooks.nix/blob/ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37/modules/hooks.nix#L2973
Using this config:
golangci-lint = {
enable = true;
args = [ "--fix" ];
};
The following output is generated:
{
"always_run": false,
"args": [
"--fix"
],
"entry": "/nix/store/y1xfcgx6821rwynpfjpp4a8s6if3mwma-precommit-golangci-lint",
"exclude": "^$",
"exclude_types": [],
"fail_fast": false,
"files": "\\.go$",
"id": "golangci-lint",
"language": "system",
"name": "golangci-lint",
"pass_filenames": true,
"require_serial": true,
"stages": [
"pre-commit"
],
"types": [
"file"
],
"types_or": [],
"verbose": false
},
But the --fix argument is not used by the golangci-lint command.