Skip to content

Commit 019a7d1

Browse files
authored
Merge pull request #1629 from forcedotcom/release-5.0.0-alpha.2
RELEASE @W-16608399@: Conducting 5.0.0 alpha.2 release
2 parents 91a1b37 + 822b2e9 commit 019a7d1

File tree

70 files changed

+2696
-1505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2696
-1505
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ indent_size = 2
2121
[*.kts]
2222
indent_style = space
2323
indent_size = 2
24+
25+
[*.goldfile]
26+
insert_final_newline = false

.github/workflows/run-tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,21 @@ jobs:
4646
path: |
4747
./reports
4848
./coverage
49+
# For now, the smoke tests are no-ops, so the job doesn't have to do anything exciting.
50+
# When smoke-tests stop being no-ops, we'll need a build-dependencies step to create a tarball artifact, and so forth.
51+
# We'll be able to use the v4 workflow as a template.
52+
smoke-tests:
53+
strategy:
54+
# By default, if any job in a matrix fails, all other jobs are automatically cancelled. This makes the jobs run
55+
# to completion instead.
56+
fail-fast: false
57+
matrix:
58+
node: ${{ fromJson(inputs.node-matrix) }}
59+
os: [{vm: ubuntu-latest, exe: .sh}, {vm: macos-latest, exe: .sh}, {vm: windows-latest, exe: .cmd}]
60+
runs-on: ${{ matrix.os.vm }}
61+
steps:
62+
- uses: actions/checkout@v4
63+
with:
64+
ref: ${{ inputs.target-branch }}
65+
- run: smoke-tests/smoke-test${{ matrix.os.exe }} sf
66+

messages/config-command.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,37 @@ Display the current state of configuration for Code Analyzer.
44

55
# command.description
66

7-
Code Analyzer gives you the ability to configure settings that modify Code Analyzer's behavior, to override the tags and severity levels of rules, and to configure the engine specific settings. Use this command to see the current state of this configuration and to save this state to a YAML-formatted file that you can modify to our needs.
7+
Code Analyzer gives you the ability to configure settings that modify Code Analyzer's behavior, to override the tags and severity levels of rules, and to configure the engine specific settings. Use this command to see the current state of this configuration. You can also save this state to a YAML-formatted file that you can modify for your needs.
88

9-
To apply a custom configuration with Code Analyzer, either keep your custom configuration settings in a 'code-analyzer.yml' file located in the current working directory from which you are executing commands, or specify the location of your custom configuration file to each of the Code Analyzer commands via the `--config-file` flag.
9+
To apply a custom configuration with Code Analyzer, either keep your custom configuration settings in a `code-analyzer.yml` file located in the current folder from which you are executing commands, or specify the location of your custom configuration file to the Code Analyzer commands with the --config-file flag.
1010

1111
# command.examples
1212

13-
- Display the current state of configuration for Code Analyzer 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:
13+
- 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:
1414

15-
<%= config.bin %> <%= command.id %>
15+
<%= config.bin %> <%= command.id %>
1616

17-
- This example is identical to the previous one, if `./code-analyzer.yml` exists.
17+
- This example is identical to the previous one, assuming that `./code-analyzer.yml` exists in your current folder.
1818

19-
<%= config.bin %> <%= command.id %> --config-file ./code-analyzer.yml --rule-selector Recommended
19+
<%= config.bin %> <%= command.id %> --config-file ./code-analyzer.yml --rule-selector Recommended
2020

21-
- Write the current state of configuration to `code-analyzer.yml`, including any configuration from an existing `code-analyzer.yml` file. This preserves all values from the original config, but will overwrite any comments:
21+
- 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:
2222

23-
<%= config.bin %> <%= command.id %> --config-file ./code-analyzer.yml --output-file code-analyzer.yml
23+
<%= config.bin %> <%= command.id %> --config-file ./code-analyzer.yml --output-file code-analyzer.yml
2424

2525
- Display the configuration state for all rules, instead of just the recommended ones:
2626

27-
<%= config.bin %> <%= command.id %> --rule-selector all
27+
<%= config.bin %> <%= command.id %> --rule-selector all
28+
2829
- Display the configuration state associated with recommended rules that are applicable to your workspace folder, `./src`:
2930

30-
<%= config.bin %> <%= command.id %> --workspace ./src
31+
<%= config.bin %> <%= command.id %> --workspace ./src
3132

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

34-
<%= config.bin %> <%= command.id %> --rule-selection eslint:no-undef
35+
<%= config.bin %> <%= command.id %> --rule-selection eslint:no-undef
3536

36-
- Load from an existing configuration called 'existing-config.yml', but write to a new configuration file called 'new-config.yml' the configuration state that is applicable to all rules that are relevant to workspace located in current working directory:
37+
- 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:
3738

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

@@ -43,11 +44,11 @@ Set of files you want to include in the code analysis.
4344

4445
# flags.workspace.description
4546

46-
If you specify this flag, the command returns a more accurate list of the rules that apply to the files that make up your workspace. Typically, a workspace is a single project folder that contains all your files. But it can also consist of one or more folders, one or more files, and use glob patterns (wildcards). If you specify this flag multiple times, then your workspace is the sum of the files and folders.
47+
Use the --workspace flag to display only the configuration associated with the rules that apply to the files that make up your workspace. Typically, a workspace is a single project folder that contains all your files. But it can also consist of one or more folders, one or more files, and use glob patterns (wildcards). If you specify this flag multiple times, then your workspace is the sum of the files and folders.
4748

48-
This command uses the type of file in the workspace, such as JavaScript or Typescript, to determine the rules to list. For example, if your workspace contains only JavaScript files, the command doesn't list TypeScript rules. The command uses a file's extension to determine what kind of file it is, such as ".ts" for TypeScript.
49+
This command uses the type of file in the workspace, such as JavaScript or Typescript, to determine the rules to include in the configuration state. For example, if your workspace contains only JavaScript files, the command doesn't include TypeScript rules. The command uses a file's extension to determine what kind of file it is, such as ".ts" for TypeScript.
4950

50-
Some engines may be configured to add additional rules based on what it finds in your workspace. For example, if you set the engines.eslint.auto_discover_eslint_config value of your code-analyzer.yml file to true, then supplying your workspace allows the "eslint" engine to examine your files in order to find ESLint configuration files that could potentially add in additional rules.
51+
Some engines may be configured to add additional rules based on what it finds in your workspace. For example, if you set the "engines.eslint.auto_discover_eslint_config" value of your `code-analyzer.yml` file to true, then supplying your workspace allows the "eslint" engine to examine your files in order to find ESLint configuration files that could potentially add in additional rules.
5152

5253
# flags.rule-selector.summary
5354

@@ -59,7 +60,7 @@ Use the --rule-selector flag to display only the configuration associated with t
5960

6061
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".
6162

62-
If this flag is not specified, then the 'Recommended' tag rule selector will be used.
63+
If you don't specify this flag, then the command uses the "Recommended" tag rule selector.
6364

6465
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.
6566

@@ -71,11 +72,11 @@ Path to the existing configuration file used to customize the engines and rules.
7172

7273
Use this flag to apply the customizations from a custom Code Analyzer configuration file to be displayed alongside the current Code Analyzer configuration state.
7374

74-
If this flag is not specified, then by default Code Analyzer will look for and apply a file named "code-analyzer.yml" or "code-analyzer.yaml" in your current working directory.
75+
If you don't specify this flag, then the command looks for and applies a file named `code-analyzer.yml` or `code-analyzer.yaml` in your current folder.
7576

7677
# flags.output-file.summary
7778

78-
Output file to write the configuration state to. The file will be written in YAML format.
79+
Output file to write the configuration state to. The file is written in YAML format.
7980

8081
# flags.output-file.description
8182

messages/config-model.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# template.last-calculated-as
2+
Last calculated by the config command as: %s
3+
4+
# template.modified-from
5+
Modified from: %s
6+
7+
# template.rule-overrides-section
8+
%s ENGINE RULE OVERRIDES
9+
10+
# template.yaml.no-engines-selected
11+
Empty object used because rule selection returned no rules
12+
13+
# template.yaml.no-rules-selected
14+
Remove this empty object {} when you are ready to specify your first rule override

messages/results-viewer.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# summary.found-no-results
2-
3-
Found 0 violations.
4-
51
# summary.detail.found-results
62

73
Found %d violation(s) across %d file(s):
@@ -10,18 +6,6 @@ Found %d violation(s) across %d file(s):
106

117
%d. %s
128

13-
# summary.detail.breakdown.header
14-
15-
Summary
16-
17-
# summary.detail.breakdown.total
18-
19-
Found %d violation(s):
20-
21-
# summary.detail.breakdown.item
22-
23-
%d %s severity
24-
259
# summary.table.found-results
2610

2711
Found %d violation(s) across %d file(s) relative to '%s':

messages/run-command.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ If you want to preview the list of rules before you actually run them, use the `
5050

5151
<%= config.bin %> <%= command.id %> --rule-selector eslint:getter-return --rule-selector no-inner-declarations
5252

53+
# command.examples.temporarily-hidden-for-now
54+
5355
- Specify three method starting points to be applied to the path-based recommended rules of the Salesforce Graph Engine, "sfge", while specifying the "./src" folder as the workspace to be used to build the source graph:
5456

5557
<%= config.bin %> <%= command.id %> --rule-selector sfge:Recommended --workspace ./src --path-start ./src/classes/Utils.cls#init --path-start ./src/classes/Helpers.cls#method1;method2

messages/run-summary-viewer.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# summary.header
2+
3+
Summary
4+
5+
# summary.found-no-violations
6+
7+
Found 0 violations.
8+
9+
# summary.violations-total
10+
11+
Found %d violation(s):
12+
13+
# summary.violations-item
14+
15+
%d %s severity violation(s) found.
16+
17+
# summary.no-outfiles
18+
19+
No results files were specified.
20+
21+
# summary.outfiles-total
22+
23+
Results written to:
24+
25+
# summary.log-file-location
26+
27+
Additional log information written to:

messages/shared.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# label.command-state
2+
3+
Developer Preview
4+
5+
# warning.command-state
6+
7+
This command is in %s.

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
{
22
"name": "@salesforce/plugin-code-analyzer",
33
"description": "Static code scanner that applies quality and security rules to Apex code, and provides feedback.",
4-
"version": "5.0.0-alpha.1",
4+
"version": "5.0.0-alpha.2",
55
"author": "Salesforce Code Analyzer Team",
66
"bugs": "https://github.com/forcedotcom/sfdx-scanner/issues",
77
"dependencies": {
88
"@oclif/core": "^3.3.2",
9-
"@salesforce/code-analyzer-core": "0.12.0",
10-
"@salesforce/code-analyzer-engine-api": "0.9.0",
11-
"@salesforce/code-analyzer-eslint-engine": "0.9.0",
12-
"@salesforce/code-analyzer-regex-engine": "0.9.0",
13-
"@salesforce/code-analyzer-retirejs-engine": "0.9.0",
9+
"@salesforce/code-analyzer-core": "^0.13.2",
10+
"@salesforce/code-analyzer-engine-api": "0.10.0",
11+
"@salesforce/code-analyzer-eslint-engine": "0.10.0",
12+
"@salesforce/code-analyzer-pmd-engine": "0.10.1",
13+
"@salesforce/code-analyzer-regex-engine": "0.10.0",
14+
"@salesforce/code-analyzer-retirejs-engine": "0.10.0",
1415
"@salesforce/core": "^5",
1516
"@salesforce/sf-plugins-core": "^5.0.4",
1617
"@salesforce/ts-types": "^2.0.9",
17-
"@types/node": "^17",
18+
"@types/js-yaml": "^4.0.9",
19+
"@types/node": "^22.5.5",
1820
"ansis": "^3.2.0",
1921
"fast-glob": "^3.3.2",
22+
"js-yaml": "^4.1.0",
2023
"ts-node": "^10",
2124
"tslib": "^2"
2225
},

smoke-tests/smoke-test-generator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ function generateScriptBody(isBash, delim) {
3535
// Log an explainer that since we're in the Alpha stage, we don't have a fully fleshed out smoke test.
3636
`echo "At this point in the alpha, the smoke tests are no-ops and it is fine."`
3737
]
38+
39+
return commands.join('\n');
3840
}
3941

4042
function generateScript(isBash, delim) {

0 commit comments

Comments
 (0)