Skip to content

Commit

Permalink
Merge pull request #41 from alta/ydnar/40
Browse files Browse the repository at this point in the history
Handle linted enum values from imported protos
  • Loading branch information
ydnar authored Mar 11, 2021
2 parents 83cc591 + fa21e5e commit 5bb12fb
Show file tree
Hide file tree
Showing 6 changed files with 350 additions and 108 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- [#40](https://github.com/alta/protopatch/issues/40): enum values renamed with `go.lint` are now usable when imported into another proto file.

## [v0.3.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion patch/patcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (p *Patcher) scanEnumValue(v *protogen.EnumValue, parent *protogen.Message)
newName = strings.TrimPrefix(newName, pname)
}
}
if newName != "" && newName != v.GoIdent.GoName {
if newName != "" {
p.RenameValue(v.GoIdent, newName)
}
}
Expand Down
Loading

0 comments on commit 5bb12fb

Please sign in to comment.