Conversation
Codecov Report
@@ Coverage Diff @@
## master #9 +/- ##
==========================================
- Coverage 58.40% 57.57% -0.84%
==========================================
Files 7 7
Lines 113 132 +19
==========================================
+ Hits 66 76 +10
- Misses 47 56 +9
Continue to review full report in Codecov by Sentry.
|
| end | ||
|
|
||
| @doc false | ||
| @spec type_from_options(struct()) :: atom() |
There was a problem hiding this comment.
| @spec type_from_options(struct()) :: atom() | |
| @spec type_from_options(struct()) :: type() |
| end | ||
|
|
||
| @doc false | ||
| @spec type_from_string(String.t()) :: atom() |
There was a problem hiding this comment.
| @spec type_from_string(String.t()) :: atom() | |
| @spec type_from_string(String.t()) :: type() |
| end | ||
|
|
||
| @doc false | ||
| @spec type_from_string(String.t()) :: atom() |
There was a problem hiding this comment.
| @spec type_from_string(String.t()) :: atom() | |
| @spec type_from_string(String.t()) :: type() |
| def type_from_string(string) do | ||
| if string in @valid_type_strings, | ||
| do: String.to_atom(string), | ||
| else: raise("Invalid component type string") |
There was a problem hiding this comment.
By convention, we call raise without parentheses (as you did in some other places).
There was a problem hiding this comment.
I'm blaming mix format for this :PP
There was a problem hiding this comment.
Yeah, it keeps adding the parentheses -- I'm afraid the mighty linter has spoken...
I guess the convention doesn't apply when using keyword list if syntax ¯_(ツ)_/¯
| defstruct @enforce_keys ++ | ||
| [ | ||
| rtpPort: 20_000, | ||
| reconnectDelay: 15_000, | ||
| keepAliveInterval: 15_000, | ||
| pierceNat: true | ||
| ] | ||
|
|
||
| @type t :: %__MODULE__{ | ||
| sourceUri: URI.t(), | ||
| rtpPort: 1..65_535, | ||
| reconnectDelay: non_neg_integer(), | ||
| keepAliveInterval: non_neg_integer(), | ||
| pierceNat: boolean() | ||
| } |
There was a problem hiding this comment.
Noticed it only now, you should use snake_case here and create a function that converts it to camelCase like we do e.g. here. Hope that won't be an issue anymore when we move to protobufs.
This PR introduces breaking changes to the creation of components