I've thought about this and rather than warning when using trailing colons
on quoted atoms. It could make sense to warn when using quoted atoms when
the characters are valid for a non-quoted atom.
%{"this": "warns"}
%{"this one": "doesn't"}
I'm also exploring adding this to credo, in case it doesn't make sense for
Elixir core.
Allen Madsen
http://www.allenmadsen.com
On Wed, Sep 13, 2017 at 6:16 PM, Allen Madsen <[email protected]> wrote:
> At work we deal with a lot of JSON and so it's common to have the
> equivalent of JSON in Elixir. A common problem people on my team have when
> they write out the Elixir structure is that they miss converting trailing
> commas into hash rockets.
>
> They have this:
>
> %{"x": 1}
>
> Instead of:
>
> %{"x" => 1}
>
> Because both look like a string, it's very easy to miss. I'm suggesting
> warning about the latter syntax as it can be a source of errors.
>
> My goal is that it become more obvious that you've made this type of
> error. If people don't like this suggestion, I'd love to hear other ideas
> about ways this problem could be addressed.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/14344c22-06a8-42c2-a827-
> 29359a826ad0%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/14344c22-06a8-42c2-a827-29359a826ad0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/CAK-y3Cv%2B9yb0XwRh9tBNiKBE%3D09RL9m7F2OXK6pUJxpNRA4%3DFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.