Coding standards (Guard)
Write down how your code should look, choose how strictly each rule is enforced, and see where the code does not follow it.
Guard is a code project's written coding standards. You say how the code should be named, how long and how complex a function may be, which imports are not allowed and so on; the Inspector then checks the code against those rules. Guard is for code projects only.
Set it up
- Add a code project. After Tell us about this project, Revly opens a second window, Configure Project Coding Standards.
- Revly proposes a profile for each language it finds (for example PHP, Python or TypeScript). Accept it, change it or leave it out.
- Revly then takes a first look at your code (the baseline) and offers the naming conventions the code already follows, so the rules fit what you have rather than what a textbook says.
- You can click Skip at any step. You can come back later with Open Guard in the project (shortcut: Ctrl/Cmd+Alt+B, Alt+Shift+B on Linux).
Enforcement levels
- Advisory: a note. It is shown, but it never counts against you.
- Warning: a finding that should be looked at.
- Mandatory: a finding that must be dealt with. Mandatory findings are shown beside the score, so they cannot hide inside an average.
Where a rule applies
A rule can apply to the whole project, to one folder or to one file. A more specific rule replaces a wider one only if it says so. If two mandatory rules disagree, Revly shows them as a conflict for you to settle; it does not pick one.
Change history
Every change to your standards is written to a history. The rows are chained together with a hash, so if a row is altered on this computer, Revly can show that the chain is broken. This is a way to notice a change, not protection against someone who has access to your disk.