Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dashes in Haskell module names #173

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

unclechu
Copy link
Contributor

@unclechu unclechu commented Oct 21, 2021

This fixes dashes appearing in generated Haskell module names when youhave *.proto files which have dashes in their names. For instance if you name your *.proto file like this: foo-bar-baz.proto you get Foo-bar-baz Haskell module name which is just broken.

With this fix if I name proto file like foo-bar---baz.proto I get module FooBarBaz where in the FooBarBaz.hs Haskell file.

Test example:

$ printf 'syntax = "proto3";\npackage foo;\n' > foo-bar---baz.proto
$ compile-proto-file --proto foo-bar---baz.proto --out x
$ grep '^module' x/FooBarBaz.hs
module FooBarBaz where

This fixes dashes appearing in generated Haskell module names when you
have `*.proto` files which have dashes in their names. For instance if
you name your `*.proto` file like this: `foo-bar-baz.proto` you get
`Foo-bar-baz` Haskell module name which is just broken.

With this fix if I name proto file like `foo-bar---baz.proto` I get
`module FooBarBaz where` in the `FooBarBaz.hs` Haskell file.
@Gabriella439 Gabriella439 merged commit 28cc920 into awakesecurity:master Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants