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
{{ message }}
Repository navigation
Commit c4e70af
Browse filesBrowse the repository at this point in the historyBrowse files
Lint Mendix Yaml files. This tool checks for common mistakes and enforces best practices. It uses OPA as policy engine. Therefore policies must be written in the powerful Rego language. Please refer to [Rego language reference](https://www.openpolicyagent.org/docs/latest/policy-reference/) for more information on the syntax and semantics.
91
91
92
-
### NOQA (Ignore document)
92
+
### NOQA (Ignore document or specific rules)
93
93
94
-
A specific document can be marked as "Skipped" if you have a line in the `documentation` field that starts with either `#noqa` or `# noqa` followed by an optional message (Case in-sensitive). This message will be included as "Skipped" reason in linting results.
94
+
Documents can be marked with noqa directives in the `documentation` field to skip linting. There are two supported formats:
95
+
96
+
#### Skip all rules (document-level noqa)
97
+
98
+
A specific document can be marked as "Skipped" for all rules if you have a line in the `documentation` field that starts with either `#noqa` or `# noqa` followed by an optional message (Case in-sensitive). This message will be included as "Skipped" reason in linting results.
99
+
100
+
Example:
101
+
```yaml
102
+
Documentation: |
103
+
#noqa This document is excluded from all linting rules
104
+
```
105
+
106
+
#### Skip specific rules (rule-level noqa)
107
+
108
+
You can skip specific rules by providing a comma-separated list of rule numbers after a colon. This allows fine-grained control over which rules to ignore.
109
+
110
+
Example:
111
+
```yaml
112
+
Documentation: |
113
+
#noqa:001_0002,001_0003 Temporarily skipping these rules due to legacy code
114
+
```
115
+
116
+
In this example, only rules `001_0002` and `001_0003` will be skipped for this document, while all other rules will still be evaluated.
117
+
118
+
**Syntax:**
119
+
- `#noqa`or `# noqa` - Skip all rules
120
+
- `#noqa:rule1,rule2,...`or `# noqa:rule1,rule2,...` - Skip specific rules
121
+
- Optional reason can be added after the rule list, separated by a space
122
+
123
+
**Notes:**
124
+
- The noqa directive is case-insensitive
125
+
- Multiple rule numbers should be separated by commas (no spaces)
126
+
- The entire line after the noqa directive will be recorded as the skip reason
127
+
128
+
#### Ignore NOQA directives (--ignore-noqa flag)
129
+
130
+
In some scenarios, you may want to run linting on all documents, including those marked with noqa directives. The `--ignore-noqa` flag allows you to temporarily disable the noqa functionality.
131
+
132
+
**Usage:**
133
+
```bash
134
+
./mxlint-cli lint --ignore-noqa
135
+
```
136
+
137
+
When this flag is set:
138
+
- All noqa directives (both document-level and rule-level) are ignored
139
+
- Documents that would normally be skipped are evaluated against all rules
140
+
- The default behavior is `false` (noqa directives are respected)
141
+
142
+
**Example scenarios:**
143
+
- **Audit mode**: Run a complete check to see all violations, even in documents marked with noqa
144
+
- **CI/CD validation**: Enforce that certain branches (e.g., production) don't rely on noqa suppressions
145
+
- **Cleanup**: Identify which noqa markers can be removed after fixing underlying issues
146
+
147
+
**Note:** When using `--ignore-noqa`, results are not cached to ensure consistency with normal linting behavior.
0 commit comments