API Reference KogenCredo v#0.1.0

View Source

Modules

Credo checks for recurring generated-code mistakes and verification integrity.

File-level alias resolution.

AST helpers shared by the KogenCredo checks.

Module-name scoping: removes the bodies of modules that a check is configured to skip (for example codec modules), resolving nested defmodule names.

Filename scoping helpers shared by the KogenCredo checks.

Lexical walk over an AST that tracks alias, import and the enclosing module.

Strict parameter validation for checks.

ExUnit-source helpers shared by the test-quality checks.

Diff-aware AST rules: judge each changed function against its own base version.

Argument handling and rendering behind mix kogen.diff_check, free of Mix.shell so it can be tested: run/1 returns {output, exit_code}.

One changed function: its base clauses (nil when the function is new) and its head clauses.

One rule hit, with text, JSON and GitHub workflow-command renderings.

Read-only git access for the diff runner.

Result of a git-range run.

A diff rule judges one changed function against its base version.

changeset-weakened: a changed function lost validations or gained a sensitive cast field.

lost-transaction: the base wrapped its writes in Repo.transaction / Repo.transact (an Ecto.Multi is run through one of these), the head has none, and at least two repo writes (insert, update, delete, insert_all, ...) remain.

new-repo-in-loop: the head has more repo calls executed once per element than the base (a likely new N+1).

new-silent-fallback: the head has more silent catch-all handlers than the base.

query-lost-limit: a changed function that builds or runs an Ecto query bounded it in SQL at the base (limit, from ... limit:, first/last, a *paginat* call) and no longer does at the head.

query-lost-scope: a changed function that still builds or runs a query compares a configured scope field (an owner or tenant id) fewer times than at the base.

widened-api: a function became public (defp to def), or a new public function appeared in a module that already existed.

Pure helpers that keep the quality gates themselves honest.

A module written in a Credo config (Credo.Check.Design.TagTODO), identified by its name.

Private plumbing shared by the Repo/query warning checks.

Shared AST helpers for the safety checks and the diff rules.

Reads ExUnit test modules out of an AST, for the async-safety checks.

Advisory finder for public functions that nothing else in the project calls.

Mix Tasks

Judges each function changed in a git range against its own base version.

Lists public functions with no caller in the project's compiled modules.