-
Notifications
You must be signed in to change notification settings - Fork 44
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
RFC Support a namespace via config #195
Comments
I think this is a good suggestion. There's one part of the behavior that I think still need some specificity, though. When a top-level
I think 1 is the more obvious, but I can see arguments for the others. We could also make the top-level |
I also like 1. I ran into this because I added Another option would be to be able to specify groups of files -
That may be overcomplicated though. |
What if we supported elixir namespaces in comments? So other compilers would ignore it. namespace cpp whatever
namespace java com.universe.milkyway.earth.whatever
#namespace elixir Whatever Kind of a hack, but on the other hand |
That's a creative solution, but after thinking about it a bit, and I'm 👎 on it because:
|
Up to this point, the only way to specify a schema's namespace was via the `namespace elixir` Thrift IDL directive. Unfortunately, the Apache Thrift compiler barks when it encounters "unknown" namespace types. This also requires all consumers of our library to explicitly add namespace directives to all of their Thrift IDL files. This change implements the simplest strategy discussed in #195: a new top-level `thrift.namespace` configuration option can be set to a global default namespace. Any schemas without its own `elixir` namespace will fall back to using this global default value.
Closed via #225 |
Using
namespace elixir MyStuff
in the .thrift files produces a pile of warnings along the lines ofwhenever running the official thrift compiler to generate code for another language.
This can be disabled by using
-nowarn
but that suppresses all warnings, which seems like a bad idea.I think supporting the
namespace
keyword is fine, but there's something wonky to me about requiring people to opt in to a pile of warnings in their pre-existing workflow. One way to get around this would be to make thenamespace
keyword optional and support a namespace option in the compile step configuration (see #194 -thrift: [namespace: MyStuff, input_files: ...]
).The text was updated successfully, but these errors were encountered: