Skip to content

Commit ad89fdc

Browse files
CHANGE(config): @W-18033471@: Make 'all' the new default value for --rule-selector for the config command
1 parent 1891900 commit ad89fdc

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

messages/config-command.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@ We're continually improving Salesforce Code Analyzer. Tell us what you think! Gi
1212

1313
# command.examples
1414

15-
- Display the current state of the Code Analyzer configuration using the default behavior: display top level configuration, display the engine and rule override settings associated with all the rules that have a "Recommended" tag; and automatically apply any existing custom configuration settings found in a `code-analyzer.yml` or `code-analyzer.yaml` file in the current folder:
15+
- Display the current state of the Code Analyzer configuration using the default behavior: display top level configuration, display the engine and rule override settings associated with all the rules; and automatically apply any existing custom configuration settings found in a `code-analyzer.yml` or `code-analyzer.yaml` file in the current folder:
1616

1717
<%= config.bin %> <%= command.id %>
1818

1919
- This example is identical to the previous one, assuming that `./code-analyzer.yml` exists in your current folder.
2020

21-
<%= config.bin %> <%= command.id %> --config-file ./code-analyzer.yml --rule-selector Recommended
21+
<%= config.bin %> <%= command.id %> --config-file ./code-analyzer.yml --rule-selector all
2222

2323
- Write the current state of configuration to the file `code-analyzer.yml`, including any configuration from an existing `code-analyzer.yml` file. The command preserves all values from the original config, but overwrites any comments:
2424

2525
<%= config.bin %> <%= command.id %> --config-file ./code-analyzer.yml --output-file code-analyzer.yml
2626

27-
- Display the configuration state for all rules, instead of just the recommended ones:
27+
- Display the configuration state for just the recommended rules, instead of all the rules:
2828

29-
<%= config.bin %> <%= command.id %> --rule-selector all
29+
<%= config.bin %> <%= command.id %> --rule-selector Recommended
3030

31-
- Display the configuration state associated with recommended rules that are applicable to your workspace folder, `./src`:
31+
- Display the configuration state associated with all the rules that are applicable to your workspace folder, `./src`:
3232

3333
<%= config.bin %> <%= command.id %> --workspace ./src
3434

3535
- Display any relevant configuration settings associated with the rule name 'no-undef' from the 'eslint' engine:
3636

37-
<%= config.bin %> <%= command.id %> --rule-selection eslint:no-undef
37+
<%= config.bin %> <%= command.id %> --rule-selector eslint:no-undef
3838

3939
- Load an existing configuration file called `existing-config.yml`, and then write the configuration to a new file called `new-config.yml`, the configuration state that is applicable to all rules that are relevant to the workspace located in the current folder:
4040

41-
<%= config.bin %> <%= command.id %> --config-file ./existing-config.yml --rule-selection all --workspace . --output-file ./subfolder-config.yml
41+
<%= config.bin %> <%= command.id %> --config-file ./existing-config.yml --workspace . --output-file ./subfolder-config.yml
4242

4343
# flags.workspace.summary
4444

@@ -62,9 +62,9 @@ Use the --rule-selector flag to display only the configuration associated with t
6262

6363
You can combine different criteria using colons to further filter the list; the colon works as an intersection. For example, "--rule-selector eslint:Security" reduces the output to only contain the configuration state associated with the rules from the "eslint" engine that have the "Security" tag. To add multiple rule selectors together (a union), specify the --rule-selector flag multiple times, such as "--rule-selector eslint:Recommended --rule-selector retire-js:3".
6464

65-
If you don't specify this flag, then the command uses the "Recommended" tag rule selector.
65+
If you don't specify this flag, then the command uses the "all" rule selector.
6666

67-
Run `<%= config.bin %> <%= command.id %> --rule-selector all` to display the configuration state associated with all possible rules available, and not just the recommended ones.
67+
Run `<%= config.bin %> <%= command.id %> --rule-selector Recommended` to display the configuration state associated with just the 'Recommended' rules, instead of all the rules.
6868

6969
# flags.config-file.summary
7070

src/commands/code-analyzer/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class ConfigCommand extends SfCommand<void> implements Displayabl
3434
char: 'r',
3535
multiple: true,
3636
delimiter: ',',
37-
default: ["Recommended"]
37+
default: ["all"]
3838
}),
3939
'config-file': Flags.file({
4040
summary: getMessage(BundleName.ConfigCommand, 'flags.config-file.summary'),

test/commands/code-analyzer/config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ describe('`code-analyzer config` tests', () => {
6060
expect(receivedActionInput).toHaveProperty('rule-selector', [...inputValue1, ...inputValue2]);
6161
});
6262

63-
it('Defaults to value of "Recommended"', async () => {
63+
it('Defaults to value of "all"', async () => {
6464
await ConfigCommand.run([]);
6565
expect(executeSpy).toHaveBeenCalled();
66-
expect(receivedActionInput).toHaveProperty('rule-selector', ["Recommended"]);
66+
expect(receivedActionInput).toHaveProperty('rule-selector', ["all"]);
6767
})
6868

6969
it('Can be referenced by its shortname, -r', async () => {

0 commit comments

Comments
 (0)