elixir-conventions

Solid

Elixir code conventions covering Elixir 1.14+/OTP 25+, pattern matching, mix format, Credo/Dialyzer, ExUnit, ExDoc, OTP process patterns, and dependency security. Load when writing or reviewing Elixir code.

Code & Development 137 stars 13 forks Updated today MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
71
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
50
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

- Elixir 1.14+ OTP 25+, pattern matching extensively, `mix format` non-negotiable. - Configure `.formatter.exs` with `:inputs` and `:import_deps` for consistent formatting across team. - Linting: a linter (e.g., Credo `--strict`), type checking: Dialyzer (via `dialyxir`). - Security: `mix_audit` for dependency CVE scanning, a SAST tool (e.g., Sobelow) for static analysis. Run both in CI. - Testing: ExUnit with `describe` blocks, `doctest` for examples, a coverage tool (e.g., excoveralls) at 80%+. - Documentation: ExDoc for generation, `@moduledoc` on all modules, `@doc` + `@spec` on public functions. - `{:ok, value}` / `{:error, reason}` tuples — never raise for expected errors. - `with` for multi-step ops, guard clauses for function overloading. - OTP: GenServer for state, Supervisor for fault tolerance, `|>` pipe for transforms. - Dependencies: commit `mix.lock`, `hex` with `~>` constraints. - Anti-patterns: mutable state outside processes, long-running NIFs, `String.to_atom` with user input.

Details

Author
Goldziher
Repository
Goldziher/ai-rulez
Created
1 years ago
Last Updated
today
Language
Go
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category