diff --git a/docs/project-conventions.md b/docs/project-conventions.md index 7a4dc60f..1602d426 100644 --- a/docs/project-conventions.md +++ b/docs/project-conventions.md @@ -97,6 +97,7 @@ Rules extracted from commit history that are specific to this project and not al - **Never leak sensitive data in prod.** `show_sensitive_data_on_connection_error: false`. - **Commits are small and single-purpose.** One logical change per commit. - **Unused aliases are removed** when their module is no longer referenced. Aliases stay alphabetically sorted. +- **Alias nested modules at the top** rather than referencing them inline (e.g. `alias LastFm.Fixtures.RecentTracks` then `RecentTracks.get()`, not `LastFm.Fixtures.RecentTracks.get()`). Enforced by Credo's `AliasUsage` check. - **Markdown sanitization via MDEx (ammonia).** Use `Markdown.to_html/1` for user content. Annotate raw output with `# sobelow_skip ["XSS.Raw"]` and a comment explaining the sanitization. - **Sobelow runs on CI and pre-commit** in skip mode for security analysis. - **ExSlop checks run via Credo** for code quality: no narrator/boilerplate docs (use `@moduledoc false` instead), no obvious/step/narrator comments, no identity `case`/`with` patterns, no `Repo.all` then filter, no `Enum.map` with inline queries. Violations are caught by CI.