pre-commit-golang icon indicating copy to clipboard operation
pre-commit-golang copied to clipboard

How To Pass Flags to staticcheck Command

Open muya opened this issue 1 year ago • 0 comments

The staticcheck command provides options to pass in flags like -tags (to specify which build flags to use) - more examples here: https://staticcheck.io/docs/running-staticcheck/cli/

So it's possible to run:

staticcheck -tags=mybuildtag ./...

How can one pass similar tags to the pre-commit hook?

Options tried

      - id: go-static-check
        args:
          - "-tags=mybuildtag"

However, it seems these are parsed as directory options.

Any guidance would be highly appreciated, thanks!

muya avatar Oct 12 '22 06:10 muya