From 2a5181e22e5797889b5f01f91bd2c94b4fa089eb Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Sat, 22 Aug 2026 12:53:25 -0600 Subject: [PATCH] Adopts ex_quality 0.14.0 format check-mode Bumps ex_quality to ~> 0.14 and sets `format: [check: true]` in .quality.exs (sui-b5y, fleet-wide decision 2026-08-22): the gate now fails on formatting drift instead of rewriting files, so unformatted code can no longer pass and agents run `mix format` themselves before committing. No file needed a pre-flip format pass - the tree was already clean. Red path verified locally: a deliberately unformatted scratch file turned the Format stage red with the file listed and its content untouched, then was removed. Updates the CLAUDE.md gate guidance that claimed the gate formats code for you. Refs: sp-987 --- .quality.exs | 9 +++++++++ CLAUDE.md | 8 +++++--- mix.exs | 2 +- mix.lock | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.quality.exs b/.quality.exs index 6b0ce56..eac82a1 100644 --- a/.quality.exs +++ b/.quality.exs @@ -23,6 +23,15 @@ compile: [ warnings_as_errors: true ], + + # Check-mode, not reformat-mode (sui-b5y, fleet-wide decision 2026-08-22): + # a gate that rewrites drifting files cannot report drift as a finding, so + # unformatted code would pass instead of going red. Drift fails the stage; + # run `mix format` yourself before committing. + format: [ + check: true + ], + credo: [ strict: true ], diff --git a/CLAUDE.md b/CLAUDE.md index ee3c679..17db44a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -145,9 +145,11 @@ mix quality # full gate: + dialyzer, deps audit, coverage floor mix test # just the suite ``` -Full `mix quality` must be green before any commit. The gate formats your code -for you - do not run `mix format` as a separate step. The gate is deliberately -smaller than statifier-ex's; `.quality.exs` records why. +Full `mix quality` must be green before any commit. The format stage runs in +check mode (`format: [check: true]` in `.quality.exs`, sp-987): drift fails +the gate and nothing is rewritten, so run `mix format` yourself before +committing. The gate is deliberately smaller than statifier-ex's; +`.quality.exs` records why. ## ExQuality (`mix quality`) diff --git a/mix.exs b/mix.exs index 0da7aed..e486ce4 100644 --- a/mix.exs +++ b/mix.exs @@ -41,7 +41,7 @@ defmodule StatifierPersistence.MixProject do {:ecto_sql, "~> 3.10", optional: true}, # Dev / test - {:ex_quality, "~> 0.13", only: :dev, runtime: false}, + {:ex_quality, "~> 0.14", only: :dev, runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:excoveralls, "~> 0.18", only: :test}, diff --git a/mix.lock b/mix.lock index de37431..47c1d6d 100644 --- a/mix.lock +++ b/mix.lock @@ -9,7 +9,7 @@ "ecto_sql": {:hex, :ecto_sql, "3.14.0", "06446ab8410d2f85bfbb80857ee224ab3b693700cbb38f6535d507449a627b2e", [:mix], [{:db_connection, "~> 2.9", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 3.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.14.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.8", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f4d8d36faf294c9417b5a37ec7ac8217ee2abdef5fcf197ba690f361548d3949"}, "erlex": {:hex, :erlex, "0.2.9", "7debbbaa9f4f368b8cd648983e0f1d7963028508e9c59e9d4ed504e94ef52a55", [:mix], [], "hexpm", "8cfffc0ec7159e6d73de2ab28a588064de80f88b2798d5cbe4482cbbc200178b"}, "ex_doc": {:hex, :ex_doc, "0.40.3", "4a972ffe64bc07dc605af487e98fc19b72a4185f55ca031b94c0552d6071c1d9", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "2756e357742fecd9749b489b85d67c9ce99c465f2e75728d9e6dc8d704b973de"}, - "ex_quality": {:hex, :ex_quality, "0.13.0", "dbe2dc02d40d7c6007d1808e677fbef34db1d1370f4814d10c6b8e46bae4cc43", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8dfc1df8b2fe5dcfff6073cd60303a09a2745a47e6b91143db32e72949dab0d2"}, + "ex_quality": {:hex, :ex_quality, "0.14.0", "702ed122c85c1d1f1dca2efab60871884e9ba6aefc492f334da51a8175543cc6", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "ac8553e6b7a6a35ada03ef748530db2c5871d69427d74a634fd37afdeabf7e24"}, "excoveralls": {:hex, :excoveralls, "0.18.5", "e229d0a65982613332ec30f07940038fe451a2e5b29bce2a5022165f0c9b157e", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "523fe8a15603f86d64852aab2abe8ddbd78e68579c8525ae765facc5eae01562"}, "file_system": {:hex, :file_system, "1.1.1", "31864f4685b0148f25bd3fbef2b1228457c0c89024ad67f7a81a3ffbc0bbad3a", [:mix], [], "hexpm", "7a15ff97dfe526aeefb090a7a9d3d03aa907e100e262a0f8f7746b78f8f87a5d"}, "jason": {:hex, :jason, "1.4.5", "2e3a008590b0b8d7388c20293e9dcc9cf3e5d642fd2a114e4cbbb52e595d940a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b0c823996102bcd0239b3c2444eb00409b72f6a140c1950bc8b457d836b30684"},