You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Java-based linter for Markdown Architectural Decision Records (MADR).
4
-
Learn more about MADR [here](https://www.ozimmer.ch/practices/2022/11/22/MADRTemplatePrimer.html).
4
+
Learn more about MADR in the [MADR template primer](https://www.ozimmer.ch/practices/2022/11/22/MADRTemplatePrimer.html).
5
5
6
6
## Run with JBang
7
7
8
8
With [JBang](https://www.jbang.dev/) installed (requires JRE 21 or newer), the
9
9
linter can be run directly from this repository without cloning:
10
10
11
-
```
11
+
```shell
12
12
jbang madrlint@adr/madrlint <madrFile>
13
13
```
14
14
15
15
Or install it as a local command:
16
16
17
-
```
17
+
```shell
18
18
jbang app install madrlint@adr/madrlint
19
19
madrlint <madrFile>
20
20
```
@@ -24,17 +24,20 @@ madrlint <madrFile>
24
24
1. Build and grab dependencies with: `.\gradlew build`
25
25
2. Test the tool with: `.\gradlew run --args="[Options] <madrFile>"`
26
26
27
-
**Arguments**
28
-
```
27
+
### Arguments
28
+
29
+
```text
29
30
<madrFile> Path to the Markdown Architectural Decision Record
30
31
(MADR) file to lint.
31
32
```
32
-
**Options**
33
33
34
-
```
34
+
### Options
35
+
36
+
```text
35
37
-h, --help Show help message and exit.
36
38
-V, --version Print version information and exit.
37
-
-n, --no-warn <disabledRules> Disable warnings for certain rules.
39
+
-n, --no-warn <disabledRules> Disable warnings for certain rules, given as rule
40
+
number or rule ID (e.g -n1 or -nMADR01).
38
41
They can either be declared separately(e.g -n1 -n2) or
39
42
chained together separated by comma(e.g -n1,2).
40
43
-o, --out <outputFile> Output the diagnostics to a file. If that file does
@@ -46,50 +49,50 @@ madrlint <madrFile>
46
49
-q, --quiet Information not relevant to the lint results will be
47
50
suppressed.
48
51
```
52
+
49
53
## Rules
50
54
55
+
Violations are reported with a rule ID such as `MADR01a`: the rule number, optionally followed by a letter identifying the specific check within that rule.
56
+
To disable a rule, pass its ID or number to `-n`/`--no-warn` (e.g., `-n MADR01` or `-n 1` disables all `MADR01` checks).
57
+
51
58
### Structural integrity
52
59
53
-
```
54
-
01. Mandatory sections: Title (a), Context and Problem Statement (b),
55
-
Considered Options (c), Decision Outcome (d) must be present.
56
-
02. No sections may be empty.
57
-
03. Chosen option must be mentioned first (b) inside Decision Outcome (a). Expected format: 'Chosen option: <chosen option>, because <rationale>'.
58
-
04. Statement of chosen option must be followed by rationale in this format 'Chosen option: <chosen option>, because <rationale>'.
59
-
05. Only the title is allowed to have heading level 1.
60
-
06. Headings must have levels conforming to template's
61
-
07. Consequences (a) and Confirmation (b), if present, must be H3 headings under Decision Outcome
|`MADR01`| The mandatory sections must be present: Title (`a`), Context and Problem Statement (`b`), Considered Options (`c`), and Decision Outcome (`d`). |
63
+
|`MADR02`| No section may be empty. |
64
+
|`MADR03`| The chosen option must be stated inside Decision Outcome (`a`), and it must come first in that section (`b`). Expected format: `Chosen option: <chosen option>, because <rationale>`. |
65
+
|`MADR04`| The statement of the chosen option must be followed by a rationale: `Chosen option: <chosen option>, because <rationale>`. |
66
+
|`MADR05`| Only the title may have heading level 1. |
67
+
|`MADR06`| Headings must have the levels given in the MADR template. |
68
+
|`MADR07`| Consequences (`a`) and Confirmation (`b`), if present, must be level-3 headings under Decision Outcome. |
63
69
64
70
### Link validity
65
71
66
-
```
67
-
11. Internet links must be valid.
68
-
12. Local links (Anchor links, local paths to resources, etc) must be valid.
@@ -58,7 +58,7 @@ public class Main implements Runnable {
58
58
privatebooleanoverride;
59
59
@Option(names = {"-q", "--quiet"}, description = "Information not relevant to the lint results will be suppressed.")
60
60
booleanquietMode;
61
-
@Option(names = {"-n", "--no-warn"}, description = "Disable warnings for certain rules. They can either be declared separately(e.g -n1 -n2) or chained together separated by comma(e.g -n1,2)", split = ",")
61
+
@Option(names = {"-n", "--no-warn"}, description = "Disable warnings for certain rules, given as rule number or rule ID (e.g -n1 or -nMADR01). They can either be declared separately(e.g -n1 -n2) or chained together separated by comma(e.g -n1,2)", split = ",", converter = RuleIdConverter.class)
0 commit comments