awakesecurity / proto3-suite

Haskell Protobuf Implementation
https://hackage.haskell.org/package/proto3-suite
Other
81 stars 56 forks source link

Fix module renaming in `compile-proto-file` #183

Closed riz0id closed 2 years ago

riz0id commented 2 years ago

This PR changes the way compile-proto-file handles generating valid Haskell module names from protobuf files, fixes issue #182.

riz0id commented 2 years ago

I added a unit test making sure that *.proto filenames get resolved correctly. I will merge these changes into master after CI finishes.

Testing code is overkill for what it's currently used for, but will make adding tests for other renaming functions in the future much easier.

riz0id commented 2 years ago

I got frustrated with trying to handle all of the edge cases (e.g. "A_") so I just rewrote renameProtoFile with parsec.