dts-linter 0.2.1 → 0.3.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -12
- package/dist/dts-linter.js +71 -71
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install -g --ignore-scripts dts-linter
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
# Lint and format specific files
|
|
27
|
-
dts-linter --
|
|
27
|
+
dts-linter --file file1.dts --file file2.dtsi --format
|
|
28
28
|
|
|
29
29
|
# Auto-discover and process all DTS files in current directory
|
|
30
30
|
dts-linter --format
|
|
@@ -37,18 +37,19 @@ dts-linter --formatFixAll
|
|
|
37
37
|
|
|
38
38
|
| Option | Type | Default | Description |
|
|
39
39
|
| ----------------------- | --------------- | --------------- | ---------------------------------------------------------------------------------------------------- |
|
|
40
|
-
| `--
|
|
40
|
+
| `--file` | string | Auto-discover | List of input files (can be repeated) |
|
|
41
41
|
| `--cwd` | string | `process.cwd()` | Set the current working directory |
|
|
42
|
-
| `--
|
|
43
|
-
| `--
|
|
42
|
+
| `--include` | string | `[]` | Paths to resolve includes (absolute or relative to CWD, can be repeated) |
|
|
43
|
+
| `--binding` | string | `[]` | Zephyr binding root directories (absolute or relative to CWD, can be repeated) |
|
|
44
44
|
| `--logLevel` | `none\|verbose` | `none` | Set the logging verbosity |
|
|
45
45
|
| `--format` | boolean | `false` | Format the specified files (automatically set to true when formatFixAll) |
|
|
46
46
|
| `--formatFixAll` | boolean | `false` | Apply formatting changes directly to files |
|
|
47
47
|
| `--processIncludes` | boolean | `false` | Process includes for formatting or diagnostics (automatically set to true when diagnosticsFull) |
|
|
48
48
|
| `--diagnostics` | boolean | `false` | Show basic syntax diagnostics |
|
|
49
|
-
| `--diagnosticsFull` | boolean | `false` | Show full diagnostics including semantic analysis (requires --
|
|
49
|
+
| `--diagnosticsFull` | boolean | `false` | Show full diagnostics including semantic analysis (requires --include, --binding for proper usage) |
|
|
50
50
|
| `--showInfoDiagnostics` | boolean | `false` | Show information-level diagnostics |
|
|
51
|
-
| `--
|
|
51
|
+
| `--patchFile` | string | - | Write formatting diff output to file |
|
|
52
|
+
| `--outputType` | string | `auto` | Output format type: auto, pretty, annotations, or json |
|
|
52
53
|
| `--help` | boolean | `false` | Show help information |
|
|
53
54
|
|
|
54
55
|
### Examples
|
|
@@ -56,30 +57,30 @@ dts-linter --formatFixAll
|
|
|
56
57
|
#### Check formatting without making changes
|
|
57
58
|
|
|
58
59
|
```bash
|
|
59
|
-
dts-linter --format --
|
|
60
|
+
dts-linter --format --file my-board.dts
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
#### Auto-fix formatting issues
|
|
63
64
|
|
|
64
65
|
```bash
|
|
65
|
-
dts-linter --formatFixAll --
|
|
66
|
+
dts-linter --formatFixAll --file my-board.dts --file my-overlay.dtsi
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
#### Full diagnostic check with include processing
|
|
69
70
|
|
|
70
71
|
```bash
|
|
71
|
-
dts-linter --diagnosticsFull --
|
|
72
|
+
dts-linter --diagnosticsFull --include ./include --binding ./zephyr/dts/bindings
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
#### Generate diff file for review
|
|
75
76
|
|
|
76
77
|
```bash
|
|
77
|
-
dts-linter --format --
|
|
78
|
+
dts-linter --format --patchFile changes.patch
|
|
78
79
|
```
|
|
79
80
|
|
|
80
81
|
## File Discovery
|
|
81
82
|
|
|
82
|
-
When no `--
|
|
83
|
+
When no `--file` option is provided, the linter automatically searches for DeviceTree files using the pattern `**/*.{dts,dtsi,overlay}` or `**/*.{dts}` when using `--diagnosticsFull` in the current working directory.
|
|
83
84
|
|
|
84
85
|
## Output Formats
|
|
85
86
|
|
|
@@ -98,9 +99,29 @@ When running in CI environments (GitHub Actions, GitLab CI, etc.), the tool auto
|
|
|
98
99
|
- `::error` for syntax errors
|
|
99
100
|
- File locations and line numbers included
|
|
100
101
|
|
|
102
|
+
### JSON
|
|
103
|
+
|
|
104
|
+
Returns a JSON object of type
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
{
|
|
108
|
+
cwd: string;
|
|
109
|
+
issues: {
|
|
110
|
+
level: string;
|
|
111
|
+
message: string;
|
|
112
|
+
title?: string;
|
|
113
|
+
file?: string;
|
|
114
|
+
startLine?: number;
|
|
115
|
+
startCol?: number;
|
|
116
|
+
endLine?: number;
|
|
117
|
+
endCol?: number;
|
|
118
|
+
}[];
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
101
122
|
### Diff Output
|
|
102
123
|
|
|
103
|
-
When using `--
|
|
124
|
+
When using `--patchFile`, generates unified diff format showing all formatting changes:
|
|
104
125
|
|
|
105
126
|
```diff
|
|
106
127
|
--- a/my-board.dts
|