https://github.com/palantir/go-generate
Go tool that runs and verifies the output of go generate
https://github.com/palantir/go-generate
octo-correct-managed
Last synced: 2 months ago
JSON representation
Go tool that runs and verifies the output of go generate
- Host: GitHub
- URL: https://github.com/palantir/go-generate
- Owner: palantir
- License: apache-2.0
- Created: 2018-03-05T04:07:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T05:31:28.000Z (8 months ago)
- Last Synced: 2024-10-24T23:35:55.647Z (8 months ago)
- Topics: octo-correct-managed
- Language: Go
- Homepage:
- Size: 16.3 MB
- Stars: 12
- Watchers: 248
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: changelog/1.2.0/pr-66.v2.yml
- License: LICENSE
Awesome Lists containing this project
README
go-generate
===========
go-generate is a tool that runs `go generate` in directories specified in the configuration. The configuration also
enables the specification of the files or directories that are expected to be produced by `go generate`, and can be run
in `verify` mode to verify whether any of the output files changed as a result of running the generator.Usage
-----
Run `./go-generate --config=generate.yml` to run the `go generate` command in the directories specified by the
configuration.Run `./go-generate --config=generate.yml --verify` to verify that running the `go generate` command for the specified
configuration did not change any of the files or directories specified by the configuration. If any of the matching
paths did change, the program prints the differences and exits with a non-0 exit code.Configuration
-------------
The configuration file specifies the "generate" configurations, which consist of the relative path to the directory in
which `go generate` should be run and matcher configuration that specifies the paths or files that should be examined to
determine whether or not running `go generate` resulted in a change. All relative paths (both for the `go generate`
location and the matchers) are evaluated relative to the working directory of the command.Here is an example configuration file:
```yml
generators:
foo:
go-generate-dir: gen
gen-paths:
paths:
- "gen/output.txt"
```