pre-commit-golang
                                
                                 pre-commit-golang copied to clipboard
                                
                                    pre-commit-golang copied to clipboard
                            
                            
                            
                        Teach run-go-unit-tests.sh about options processing
This modifies run-go-unit-tests.sh to expose several "go test" command line options, including those related to code coverage. It is now possible to configure a hook like this:
- repo: git://github.com/dnephin/pre-commit-golang
  rev: master
  hooks:
    - id: go-unit-tests
      args:
        - -coverprofile
        - coverage.out
Do you think we need to handle the rest of the args explicitly? Or could we do more of a passthrough of the rest of $@
I thought about that, but I can't think of a sane way to do it: arguments may take no arguments (-cover) or they may take a single argument (-coverprofile coverage.out), and any arguments passed in are of course followed by the list of filenames provided by pre-commit.
There's no way to write a general passthrough that knows which options take arguments and which don't -- other by enumerating them all individually.
Any updates regarding this? I would like to see this merged so we can modify our timeout option as well. Is it ready to be merged or is additional work needed?