By: Tom Sydney Kerckhove <syd@cs-syd.eu>
Check a repository against one rule hopinion reads every module of every cabal component and reports what the rules have to say about it. One rule ships, HsNoCustomShowRead from haskell-style.md, so that the machinery is exercised by something real rather than by a demonstration. The shape it is built on: A rule says there is something to fix or there is not. There is no third answer, because a checker whose silence can mean "I could not tell" is a checker whose silence means nothing. A module that did not parse is a failure of the run rather than a module with nothing wrong in it, and a module whose source is a preprocessor's input is counted as unread. A rule is a value in a registry rather than an instance of a class: no generic code is polymorphic in a check type, so a record of functions is the right encoding. Adding a rule is a module and a line in a list, plus a directory of resources that becomes a golden test per file with no test code to write. Comments, spans and declarations are read from the token stream and the parse tree rather than from exact-print annotations, because that placement answers "where must this be reprinted" and not "what is this about". Nothing here is built for a rule that does not exist yet. One level, no fact store, no cross-process split, and nothing reads what the compiler wrote down, because one module-level rule needs none of them. The build is what holds that line: -Wunused-packages, -Wunused-top-binds and weeder run as errors, and they are what removed the last of the machinery this rule turned out not to need. It cannot be adopted yet, and the rule it ships is the reason: haskell-style.md allows a written Show for data that is secret, and there is no way to say so. Suppressions come next, with the rule that makes them unavoidable.
| Time to Start | Worker time | Duration | Time to finish | Idle | |
| Config | 0s | 1s | 1s | 1s | 0s |
| Eval | 1s | 11s | 11s | 12s | 0s |
| Build | 11s | 0s | 0s | 11s | 0s |
| Suite | 0s | 12s | 12s | 12s | 0s |