Open
Conversation
- Renamed `Mix.Gleam.require!/0` to `Mix.Gleam.requirements!/0` as it has a
different meaning in Elixir.
- Added/ `@spec` annotations to public functions.
- Avoided making functions raise and return results (`{:ok, value}` |
`{:error, message}`)
- Now every function that raises ends with a ! (with the exception of
`Mix.Gleam.load_config/1` due to consistency with the Rebar compiler)
- Avoided raising from Elixir functions, and raise with `Mix.raise/1` almost
exclusively, raising with a descriptive message as opposed to raising with a
generic message and a stacktrace. The exceptions are the use of
`JSON.decode!/1` since there's no way to translate the error atoms to string
messages, as well as `File.cd!/2`.
- Simplify the calls to `Mix.raise/1` with the introduction oof a helper.
Now only 3 times the helper is called to return the value in the
`{:ok, value}` tuple, or to `Mix.raise` with a message.
- `Mix.Gleam.parse_dep!/2` now users pattern matching to build its specs.
- Renamed `@required_gleam_version` to `@gleam_version_requirement` for clarity.
- `Mix.Gleam.requirements!/0` raises with a descriptive message saying the
minimum gleam version isn't met, as opposed to before where if this
requirement is not met it wouldn't even raise
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renamed
Mix.Gleam.require!/0toMix.Gleam.requirements!/0as it has a different meaning in Elixir.Added/
@specannotations to public functions.Avoided making functions raise and return results (
{:ok, value}|{:error, message})Now every function that raises ends with a ! (with the exception of
Mix.Gleam.load_config/1due to consistency with the Rebar compiler)Avoided raising from Elixir functions, and raise with
Mix.raise/1almost exclusively, raising with a descriptive message as opposed to raising with a generic message and a stacktrace. The exceptions are the use ofJSON.decode!/1since there's no way to translate the error atoms to string messages, as well asFile.cd!/2.Simplify the calls to
Mix.raise/1with the introduction of a helper. Now only 3 times the helper is called to return the value in the{:ok, value}tuple, or toMix.raisewith a message.Mix.Gleam.parse_dep!/2now users pattern matching to build its specs.Renamed
@required_gleam_versionto@gleam_version_requirementfor clarity.Mix.Gleam.requirements!/0raises with a descriptive message saying the minimum gleam version isn't met, as opposed to before where if this requirement is not met it wouldn't even raise