-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improves error logging when the `sfdx` command is executed. Updates README with better instructions for all input parameters.
- Loading branch information
1 parent
47008f9
commit 6d03b85
Showing
4 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ Runs sfdx-scanner on a pull request or individual commit and generates in-line c | |
|
||
## Inputs | ||
|
||
| NOTE: All inputs are optional | | ||
| ----------------------------- | | ||
|
||
## `category` | ||
|
||
Categor(ies) of rules to run. | ||
|
@@ -24,7 +27,34 @@ Location of eslintrc config to customize eslint engine. | |
|
||
## `pmdconfig` | ||
|
||
Location of PMD rule reference XML file to customize rule selection | ||
Location of PMD rule reference XML file to customize rule selection. | ||
|
||
### Multiple PMD Rulesets | ||
|
||
To use multiple rulesets within the scan, make a top level file such as `masterRuleset.xml` and include the paths to the other ruleset files: | ||
|
||
``` | ||
. | ||
├── masterRuleset.xml | ||
├── ruleset1.xml | ||
└── ruleset2.xml | ||
``` | ||
|
||
```xml | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="master" | ||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> | ||
<description>Master Ruleset</description> | ||
<rule ref="ruleset1.xml" /> | ||
<rule ref="ruleset2.xml" /> | ||
</ruleset> | ||
``` | ||
|
||
```yml | ||
pmdconfig: masterRuleset.xml | ||
``` | ||
## `severity-threshold` | ||
|
||
|
@@ -40,17 +70,18 @@ Optionally provide this to scan a whole directory instead of just the diff. If t | |
|
||
## `tsconfig` | ||
|
||
Location of tsconfig.json file | ||
Location of tsconfig.json file. | ||
|
||
## `report-mode` | ||
|
||
Details which way to report issues back to GitHub, can be either: | ||
|
||
- `check-runs` - Shows findings as annotations on the PR (default) | ||
- `comments` - Shows findings as comments | ||
|
||
## `delete-resolved-comments` | ||
|
||
When set to true, will delete resolved comments from a PR. Defaults to `false`. Will do nothing unless `report-mode` is set to `comments` | ||
When set to true, will delete resolved comments from a PR. Defaults to `false`. Will do nothing unless `report-mode` is set to `comments`. | ||
|
||
## Example usage | ||
|
||
|
@@ -74,9 +105,9 @@ jobs: | |
sfdx plugins:install @salesforce/sfdx-scanner | ||
|
||
- name: Run SFDX Scanner - Report findings as comments | ||
uses: mitchspano/[email protected].8 | ||
uses: mitchspano/[email protected].12 | ||
with: | ||
pmdconfig: ruleset.xml | ||
pmdconfig: masterRuleset.xml | ||
severity-threshold: 4 | ||
strictly-enforced-rules: '[{ "engine": "pmd", "category": "Performance", "rule": "AvoidDebugStatements" }]' | ||
env: | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters