gopatch
gopatch copied to clipboard
Refactoring and code transformation tool for Go.
Currently, patches with elisions only replace the first instance of the matched contents. For example, ```diff f(..., - "GET", + constants.Get, ..., ) ``` This will only replace the first...
Elision correlation between the `-` and `+` sections of a patch is very naive right now. It matches based on positions of the ellipses in the patch, so it can...
The machinery for parsing patches is currently convoluted, with multiple temporary files created inside token.FileSets so that when failures do occur, we have no obvious correlation to positions in the...
gopatch is completely quiet right now. We should add flags for verbosity. Initial ideas: - `-v` flag for verbose mode where we'll list whether we changed files or not -...
We should support elision in value declarations. e.g., ```diff -var a, ..., c string +var a, ..., c int ``` ```diff var ( ... - name = value + _name...
gopatch requires exactly one entity after the package name (if any) and imports. Patches that affect only imports are not supported. This fails: ```diff @@ @@ -import "example.com/foo-go" +import "example.com/foo"...
Diffs in a patch can currently transform only one entity at a time. That is, ```diff @@ @@ type Foo struct { - bar string } @@ @@ type Bar...
This diff adds the flag `--skip-generated` or short-form `-g` to be able to skip running gopatch on files containing generated code. When the flag is set to true, if the...
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. Release notes Sourced from codecov/codecov-action's releases. v4.0.0 v4 of the Codecov Action uses the CLI as the underlying upload. The CLI has helped to...
I have some files that import the same library package multiple times with different names: ``` import log "github.com/sirupsen/logrus" import "github.com/sirupsen/logrus" ``` I was hoping to write a gopatch to...