dts-linter 0.2.1 → 0.3.0-beta2

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 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 --files file1.dts --files file2.dtsi --format
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
@@ -35,51 +35,52 @@ dts-linter --formatFixAll
35
35
 
36
36
  ### Command Line Options
37
37
 
38
- | Option | Type | Default | Description |
39
- | ----------------------- | --------------- | --------------- | ---------------------------------------------------------------------------------------------------- |
40
- | `--files` | string | Auto-discover | List of input files (can be repeated) |
41
- | `--cwd` | string | `process.cwd()` | Set the current working directory |
42
- | `--includes` | string | `[]` | Paths to resolve includes (absolute or relative to CWD, can be repeated) |
43
- | `--bindings` | string | `[]` | Zephyr binding root directories (absolute or relative to CWD, can be repeated) |
44
- | `--logLevel` | `none\|verbose` | `none` | Set the logging verbosity |
45
- | `--format` | boolean | `false` | Format the specified files (automatically set to true when formatFixAll) |
46
- | `--formatFixAll` | boolean | `false` | Apply formatting changes directly to files |
47
- | `--processIncludes` | boolean | `false` | Process includes for formatting or diagnostics (automatically set to true when diagnosticsFull) |
48
- | `--diagnostics` | boolean | `false` | Show basic syntax diagnostics |
49
- | `--diagnosticsFull` | boolean | `false` | Show full diagnostics including semantic analysis (requires --includes, --bindings for proper usage) |
50
- | `--showInfoDiagnostics` | boolean | `false` | Show information-level diagnostics |
51
- | `--outFile` | string | - | Write formatting diff output to file |
52
- | `--help` | boolean | `false` | Show help information |
38
+ | Option | Type | Default | Description |
39
+ | ----------------------- | --------------- | --------------- | -------------------------------------------------------------------------------------------------- |
40
+ | `--file` | string | Auto-discover | List of input files (can be repeated) |
41
+ | `--cwd` | string | `process.cwd()` | Set the current working directory |
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
+ | `--logLevel` | `none\|verbose` | `none` | Set the logging verbosity |
45
+ | `--format` | boolean | `false` | Format the specified files (automatically set to true when formatFixAll) |
46
+ | `--formatFixAll` | boolean | `false` | Apply formatting changes directly to files |
47
+ | `--processIncludes` | boolean | `false` | Process includes for formatting or diagnostics (automatically set to true when diagnosticsFull) |
48
+ | `--diagnostics` | boolean | `false` | Show basic syntax diagnostics |
49
+ | `--diagnosticsFull` | boolean | `false` | Show full diagnostics including semantic analysis (requires --include, --binding for proper usage) |
50
+ | `--showInfoDiagnostics` | boolean | `false` | Show information-level diagnostics |
51
+ | `--patchFile` | string | - | Write formatting diff output to file |
52
+ | `--outputType` | string | `auto` | Output format type: auto, pretty, annotations, or json |
53
+ | `--help` | boolean | `false` | Show help information |
53
54
 
54
55
  ### Examples
55
56
 
56
57
  #### Check formatting without making changes
57
58
 
58
59
  ```bash
59
- dts-linter --format --files my-board.dts
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 --files my-board.dts --files my-overlay.dtsi
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 --includes ./include --bindings ./zephyr/dts/bindings
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 --outFile changes.patch
78
+ dts-linter --format --patchFile changes.patch
78
79
  ```
79
80
 
80
81
  ## File Discovery
81
82
 
82
- When no `--files` 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
+ 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 `--outFile`, generates unified diff format showing all formatting changes:
124
+ When using `--patchFile`, generates unified diff format showing all formatting changes:
104
125
 
105
126
  ```diff
106
127
  --- a/my-board.dts