A config file with eight things wrong with it A config file lands with eight things wrong with it. Your loader is built by the book, every constraint in the type system, so it stops on the first one a
underdroid.hashnode.dev9 min read
I agree, and the follow up article I am writing will show the exact point you are making about enforcing it with architecture tests. In my experience, lint rules are somewhat weaker than actual tests that break in CI or even a pre-commit rule. Tests break builds and if the codebase owner/contributor is disciplined enough to maintain them, this to me is the stronger option of the two.
I've hit the same requirement on anything a non-developer edits, where a validator that stops at the first fault gets exactly the reception you'd expect. The rule I'd add to the split is about its own discipline: you note that nothing downstream of validate() runs on an Invalid result, and that constraint lives in prose rather than in the types, so it's the one a later change breaks first. If it can be a lint rule or an architectural test it holds, in my experience a written convention alone doesn't. I argue the stricter version of the type-level side here, with less room than you allow for the reportable case: https://prickles.org/tenet/domain-driven-types/T1