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
Copy file name to clipboardExpand all lines: README.md
+117Lines changed: 117 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,123 @@ You will see a summary of the policy evaluations in the terminal and a report in
43
43
44
44
Do you want to create your own policies? Please refer to our guide [Create new policy](./docs/create-new-policy.md)
45
45
46
+
## Subcommands Reference
47
+
48
+
### export-model
49
+
50
+
Export Mendix model to yaml files. The output is a text representation of the model. It is a one-way conversion that aims to keep the semantics yet readable for humans and computers.
51
+
52
+
**Usage:**
53
+
```bash
54
+
mxlint-cli export-model [flags]
55
+
```
56
+
57
+
**Flags:**
58
+
| Flag | Short | Default | Description |
59
+
|------|-------|---------|-------------|
60
+
|`--input`|`-i`|`.`| Path to directory or mpr file to export. If it's a directory, all mpr files will be exported |
61
+
|`--output`|`-o`|`modelsource`| Path to directory to write the yaml files. If it doesn't exist, it will be created |
|`--filter`|`-f`|| Regex pattern to filter units by name. Only units with names matching the pattern will be exported |
64
+
|`--raw`||`false`| If set, the output yaml will include all attributes as they are in the model |
65
+
|`--appstore`||`false`| If set, appstore modules will be included in the output |
66
+
|`--verbose`||`false`| Turn on for debug logs |
67
+
68
+
---
69
+
70
+
### lint
71
+
72
+
Evaluate Mendix model against rules. Requires the model to be exported first. The model is evaluated against a set of rules defined in OPA Rego files or JavaScript. The output is a list of checked rules and their outcome.
73
+
74
+
**Usage:**
75
+
```bash
76
+
mxlint-cli lint [flags]
77
+
```
78
+
79
+
**Flags:**
80
+
| Flag | Short | Default | Description |
81
+
|------|-------|---------|-------------|
82
+
|`--rules`|`-r`|`.mendix-cache/rules`| Path to directory with rules |
83
+
|`--modelsource`|`-m`|`modelsource`| Path to directory with exported model |
84
+
|`--xunit-report`|`-x`|| Path to output file for xunit report. If not provided, no xunit report will be generated |
85
+
|`--json-file`|`-j`|| Path to output file for JSON report. If not provided, no JSON file will be generated |
86
+
|`--ignore-noqa`||`false`| Ignore noqa directives in documents |
87
+
|`--no-cache`||`false`| Disable caching of lint results. By default, results are cached and reused if rules and model files haven't changed |
88
+
|`--verbose`||`false`| Turn on for debug logs |
89
+
90
+
---
91
+
92
+
### serve
93
+
94
+
Run a server that exports model and lints whenever the input MPR file changes. Works in standalone mode and via integration with the Mendix Studio Pro extension.
95
+
96
+
**Usage:**
97
+
```bash
98
+
mxlint-cli serve [flags]
99
+
```
100
+
101
+
**Flags:**
102
+
| Flag | Short | Default | Description |
103
+
|------|-------|---------|-------------|
104
+
|`--input`|`-i`|`.`| Path to directory or mpr file to export. If it's a directory, all mpr files will be exported |
105
+
|`--output`|`-o`|`modelsource`| Path to directory to write the yaml files. If it doesn't exist, it will be created |
|`--rules`|`-r`|`.mendix-cache/rules`| Path to directory with rules |
108
+
|`--port`|`-p`|`8082`| Port to run the server on |
109
+
|`--debounce`|`-d`|`500`| Debounce time in milliseconds for file change events |
110
+
|`--verbose`||`false`| Turn on for debug logs |
111
+
112
+
---
113
+
114
+
### test-rules
115
+
116
+
Ensure rules are working as expected against predefined test cases. When you are developing a new rule, you can use this command to ensure it works as expected.
117
+
118
+
**Usage:**
119
+
```bash
120
+
mxlint-cli test-rules [flags]
121
+
```
122
+
123
+
**Flags:**
124
+
| Flag | Short | Default | Description |
125
+
|------|-------|---------|-------------|
126
+
|`--rules`|`-r`|`.mendix-cache/rules`| Path to directory with rules |
127
+
|`--verbose`||`false`| Turn on for debug logs |
128
+
129
+
---
130
+
131
+
### cache-clear
132
+
133
+
Clear the lint results cache. Removes all cached lint results. The cache is used to speed up repeated linting operations when rules and model files haven't changed.
134
+
135
+
**Usage:**
136
+
```bash
137
+
mxlint-cli cache-clear [flags]
138
+
```
139
+
140
+
**Flags:**
141
+
| Flag | Short | Default | Description |
142
+
|------|-------|---------|-------------|
143
+
|`--verbose`||`false`| Turn on for debug logs |
144
+
145
+
---
146
+
147
+
### cache-stats
148
+
149
+
Show cache statistics. Displays information about the cached lint results, including number of entries and total size.
150
+
151
+
**Usage:**
152
+
```bash
153
+
mxlint-cli cache-stats [flags]
154
+
```
155
+
156
+
**Flags:**
157
+
| Flag | Short | Default | Description |
158
+
|------|-------|---------|-------------|
159
+
|`--verbose`||`false`| Turn on for debug logs |
160
+
161
+
---
162
+
46
163
## export-model
47
164
48
165
Mendix models are stored in a binary file with `.mpr` extension. This project exports Mendix model to a human readable format, such as Yaml. This enables developers to use traditional code analysis tools on Mendix models. Think of quality checks like linting, code formatting, etc.
0 commit comments