Skip to content

Commit 1f6f018

Browse files
NEW: @W-17916450@ update v5 CLI to allow rules to be saved to JSON (Part 2)
1 parent 7a4b56b commit 1f6f018

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

messages/rules-command.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ We're continually improving Salesforce Code Analyzer. Tell us what you think! Gi
3232

3333
<%= config.bin %> <%= command.id %> --rule-selector eslint:all
3434

35-
- List all rules for all engines:
35+
- List the details about all rules for all engines; also write the rules in JSON format to a file called "rules.json" in the "out" folder, which must already exist:
3636

37-
<%= config.bin %> <%= command.id %> --rule-selector all
37+
<%= config.bin %> <%= command.id %> --rule-selector all --output-file ./out/rules.json --view detail
3838

3939
- Get a more accurate list of the rules that apply specifically to your workspace (all the files in the current folder):
4040

@@ -102,14 +102,16 @@ Format to display the rules in the terminal.
102102

103103
# flags.view.description
104104

105-
The format `table` is concise and shows minimal output, the format `detail` shows all available information. If you specify neither --view nor --output-file, then the default table view is shown. If you specify --output-file but not --view, only summary information is shown.
105+
The format `table` is concise and shows minimal output, the format `detail` shows all available information.
106+
107+
If you specify neither --view nor --output-file, then the default table view is shown. If you specify --output-file but not --view, only summary information is shown in the terminal.
106108

107109
# flags.output-file.summary
108110

109-
Output file location to write the selected rules. The file is written in JSON format.
111+
Name of the file where the selected rules are written. The file format depends on the extension you specify; currently, only .json is supported for JSON-formatted output.
110112

111113
# flags.output-file.description
112114

113-
Use this flag to write the selected rules to a JSON file. For example: "--output-file ./out/rules.json” creates a JSON results file in the "./out" folder. If the file exists already, it will be overwritten.
115+
If you specify a folder, such as "--output-file ./out/rules.json", the folder must already exist or you get an error. If the file already exists, it's overwritten without prompting.
114116

115-
If you don't specify this flag, the command outputs the rules in the terminal. The view flag can be used in combination with this flag to save the file and output the results.
117+
If you don't specify this flag, the command outputs the rules to only the terminal.

messages/rules-writer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# error.unrecognized-file-format
22

3-
The output file %s has an unsupported extension. Valid extensions include: .json.
3+
The output file %s has an unsupported extension. Valid extension(s): .json.

messages/run-command.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,23 @@ If you specify neither --view nor --output-file, then the default table view is
126126

127127
# flags.output-file.summary
128128

129-
Output file that contains the analysis results. The file format depends on the extension you specify, such as .csv, .html, .xml, and so on.
129+
Name of the file where the analysis results are written. The file format depends on the extension you specify, such as .csv, .html, .xml, and so on.
130130

131131
# flags.output-file.description
132132

133-
If you don't specify this flag, the command outputs the results in the terminal. Use this flag to print the results to a file; the format of the results depends on the extension you provide. For example, "--output-file results.csv" creates a comma-separated values file. You can specify one of these extensions:
133+
If you don't specify this flag, the command outputs the results to only the terminal. Use this flag to print the results to a file; the format of the results depends on the extension you provide. For example, "--output-file results.csv" creates a comma-separated values file. You can specify one of these extensions:
134134

135135
- .csv
136136
- .html or .htm
137137
- .json
138138
- .sarif or .sarif.json
139139
- .xml
140140

141-
To output the results to multiple files, specify this flag multiple times. For example: "--output-file ./out/results.json --output-file ./out/report.html" creates a JSON results file and an HTML file in the "./out" folder.
141+
To output the results to multiple files, specify this flag multiple times. For example: "--output-file results.json --output-file report.html" creates both a JSON results file and an HTML file.
142+
143+
If you specify a folder, such as "--output-file ./out/results.json", the folder must already exist or you get an error. If the file already exists, it's overwritten without prompting.
142144

143145
# error.invalid-severity-threshold
144146

145147
Expected --severity-threshold=%s to be one of: %s
148+

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1771,10 +1771,10 @@
17711771
strip-ansi "6.0.1"
17721772
ts-retry-promise "^0.8.1"
17731773

1774-
"@salesforce/code-analyzer-core@0.23.0":
1775-
version "0.23.0"
1776-
resolved "https://registry.yarnpkg.com/@salesforce/code-analyzer-core/-/code-analyzer-core-0.23.0.tgz#c0527bba10303d60f71cbbe0e65b5c08ce6608cd"
1777-
integrity sha512-tjq5eaatKnyqYwdLSKn5RpglrfoeAwzRaCykvndQZBqWopntyjB7KYrX0sBXLRXRCHpwXVj7mpp84t+vj4dP8w==
1774+
"@salesforce/code-analyzer-core@0.24.0":
1775+
version "0.24.0"
1776+
resolved "https://registry.yarnpkg.com/@salesforce/code-analyzer-core/-/code-analyzer-core-0.24.0.tgz#5381143f05ef4c76b56aa4f58505dea2c7cd9b4a"
1777+
integrity sha512-VvFWJqd4bi/862gExO2pp7kKhN4HYyOgqiV0E669LzqMyN7McqdRQFiew93o8cKxuzs49R/D3EKFiB+jenU3vQ==
17781778
dependencies:
17791779
"@salesforce/code-analyzer-engine-api" "0.18.0"
17801780
"@types/js-yaml" "^4.0.9"

0 commit comments

Comments
 (0)