What would you like to see in Elixir 2?

Hope this is not viewed as necroing a thread.

Related to a recent discussion here – Module naming conventions – I would actually like to see Elixir 2.x enforce a file name and a module name to be the same (with CamelCase <-> snake_case compatibilty, say MyApp module can belong to both MyApp.ex and my_app.ex).

Furthermore I would also suggest enforcing only one module per file but that might be tricky; imagine a 5-line protocol and then 5 implementations 10 lines each, all in 6 different files – might be an overkill. But maybe the protocol implementations can be exempt from the rule.

EDIT: As pointed out by @axelson, Credo could allow this in the future: https://github.com/rrrene/credo/pull/587

5 Likes