Docs
Review guidelines
What a Truecount review is held to, and how to set it.
Where the standard comes from
A review run by the Truecount agents workflow reads up to two files before it reads your change. Truecount's server reads them, not the pull request, so a pull request cannot rewrite the rules it is reviewed against.
The review Truecount runs without that workflow reads only your repository's own file, from the base commit.
| File | Where it is read from | When it is used |
|---|---|---|
Your repository's guidelines, .github/review-guidelines.md unless review.guidelines names another path | The pull request's base commit | Whenever it exists. It covers what is true in this repository and nowhere else. |
Shared guidelines, named by review.shared_guidelines | The default branch of the repository it names | Whenever it is named. One file that every repository of an account can point at. Where it overlaps a repository's own file, the shared file wins, because it is the single copy. |
| Truecount's default guidelines, below | Truecount | Only when a repository has neither. The review says so in its first line and links this page. |
# .github/truecount.yml, read from your default branch
review:
guidelines: .github/review-guidelines.md # this repository's own
shared_guidelines: acme/standards:REVIEW.md # owner/repo:path, shared by every repository
The Truecount App must be installed on the repository that holds the shared file. A private repository's shared file is not used to review a public repository, because the review's run log is public there. If a shared file cannot be used, the review says why in its first line rather than going ahead as if it had read it.
Truecount's default review guidelines
These are used only when a repository has no guidelines of its own. They are general on purpose, and that is their weakness. A reviewer that knows only general rules spends its attention on what any codebase might get wrong, and can miss the one change that breaks a rule only your repository has. A file at .github/review-guidelines.md replaces them. The best one lists what your repository exists to protect.
The invariants. A change that weakens any of these is the finding.
Behaviour the change did not mean to change stays the same. A refactor that alters an output, an error, a default or an order is a finding, with the input that shows it.
Input from outside is not trusted. A request, a file, a webhook or a model's output must not reach SQL, a shell, a file path, a template or a redirect without validation or escaping.
Access checks are not weakened. A route, query or command that skips the check its neighbours make, or widens who can read or change something, is a finding.
Secrets stay out of code, logs, error messages and URLs.
Data is not lost. A migration, deletion or overwrite that cannot be undone needs the guard its neighbours have.
Failures are not hidden. An exception swallowed, an error turned into a default value, or a failed step reported as success is a finding.
A public interface keeps its contract. A renamed field, a changed signature, a removed option or a changed default that callers outside this change depend on is a breaking change, and it should say so.
Things that are worth saying
- A test that cannot fail, or that asserts the value it just set.
- New behaviour with no test, where the code around it is tested.
- A loop or query whose size grows with input a user controls, on a path that serves requests.
- A file, connection or lock not released on the error path.
- Shared state changed without the lock or transaction its neighbours use.
- A comment or docstring that the change made untrue.
Things that are not worth saying
- Style, formatting, import order, line length. A formatter or linter owns those. Match the file.
- Naming preferences, unless a name says something untrue.
- Abstractions the code around the change does not already use.
- Something that was wrong before this change.
- Praise. If nothing is wrong, say so in one line.
How to report
Lead with the most severe finding. For each one: the file and line, what breaks, and the input or sequence that shows it. If you cannot say how it fails, it is a preference, not a finding. Ask a question instead.
Say plainly when you found nothing. A review that manufactures a finding to look useful trains its reader to skim.