Skip to content

Commit

Permalink
switched to native html report
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin committed Jan 12, 2022
1 parent 03b00df commit aee1d2c
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SCANNER_VERSION=v0.1
SCANNER_VERSION=v0.2
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SFDX Scanner Wrapper

This is a set of scanner commands for Salesforce development
## Version: 0.1
## Version: 0.2
## Usage

```
wget https://github.com/Ko-Sit/salesforce-code-review/releases/download/0.1/scanner-v0.1.zip # release zip url
wget https://github.com/Ko-Sit/salesforce-code-review/releases/download/0.2/scanner-v0.2.zip # release zip url
unzip scanner-v0.1.zip
unzip scanner-v0.2.zip
chmod +x ./scanner/run.sh # optional
Expand Down
15 changes: 4 additions & 11 deletions scripts/scanner/apex/scan_pmd_apex.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/bin/bash
source ./scanner/pre/variables.sh
REPORT_NAME="scan-pmd-apex"
REPORT_PATH="$REPORT_FOLDER/$REPORT_NAME"
REPORT_CSV="$REPORT_PATH.csv"
REPORT_XML="$REPORT_PATH.xml"
REPORT_NAME="scan-pmd-apex.html"
REPORT_HTML="$REPORT_FOLDER/$REPORT_NAME"
PMD_CONFIG_APEX="./scanner/rules/pmd-ruleset-apex.xml"
sfdx scanner:run --format csv \
sfdx scanner:run --format html \
--target $TARGET_SOURCE \
--pmdconfig $PMD_CONFIG_APEX \
--engine pmd \
--outfile $REPORT_CSV
sfdx scanner:run --format junit \
--target $TARGET_SOURCE \
--pmdconfig $PMD_CONFIG_APEX \
--engine pmd \
--outfile $REPORT_XML
--outfile $REPORT_HTML
9 changes: 6 additions & 3 deletions scripts/scanner/cpd/scan_copy_paste.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
source ./scanner/pre/variables.sh
REPORT_NAME="scan-duplicate-code.csv"
REPORT_PATH="$REPORT_FOLDER/$REPORT_NAME"
REPORT_NAME="scan-duplicate-code.html"
REPORT_HTML="$REPORT_FOLDER/$REPORT_NAME"
export NODE_OPTIONS=--max_old_space_size=4096 # avoid heap limit
sfdx scanner:run --target $TARGET_SOURCE_CPD --engine cpd --outfile $REPORT_PATH
sfdx scanner:run --format html \
--target $TARGET_SOURCE_CPD \
--engine cpd \
--outfile $REPORT_HTML


8 changes: 4 additions & 4 deletions scripts/scanner/lwc/scan_eslint_lwc.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
source ./scanner/pre/variables.sh
REPORT_NAME="scan-eslint-lwc.csv"
REPORT_PATH="$REPORT_FOLDER/$REPORT_NAME"
REPORT_NAME="scan-eslint-lwc.html"
REPORT_HTML="$REPORT_FOLDER/$REPORT_NAME"
sfdx scanner:run --engine "eslint-lwc" \
--format csv \
--format html \
--category "LWC" \
--outfile $REPORT_PATH \
--outfile $REPORT_HTML \
--target $TARGET_SOURCE_LWC
15 changes: 4 additions & 11 deletions scripts/scanner/lwc/scan_pmd_js.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/bin/bash
source ./scanner/pre/variables.sh
REPORT_NAME="scan-pmd-js"
REPORT_PATH="$REPORT_FOLDER/$REPORT_NAME"
REPORT_CSV="$REPORT_PATH.csv"
REPORT_XML="$REPORT_PATH.xml"
REPORT_NAME="scan-pmd-js.html"
REPORT_HTML="$REPORT_FOLDER/$REPORT_NAME"
PMD_CONFIG_JS="./scanner/rules/pmd-ruleset-js.xml"
sfdx scanner:run --format csv \
sfdx scanner:run --format html \
--target $TARGET_SOURCE \
--pmdconfig $PMD_CONFIG_JS \
--engine pmd \
--outfile $REPORT_CSV
sfdx scanner:run --format junit \
--target $TARGET_SOURCE \
--pmdconfig $PMD_CONFIG_JS \
--engine pmd \
--outfile $REPORT_XML
--outfile $REPORT_HTML
16 changes: 0 additions & 16 deletions scripts/scanner/post/beautify_reports.sh

This file was deleted.

8 changes: 0 additions & 8 deletions scripts/scanner/post/generate_html.sh

This file was deleted.

3 changes: 1 addition & 2 deletions scripts/scanner/post/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
echo "running post-run"
bash ./scanner/post/beautify_reports.sh
bash ./scanner/post/generate_html.sh
# bash ./scanner/post/beautify_reports.sh
15 changes: 4 additions & 11 deletions scripts/scanner/visualforce/scan_pmd_vf.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/bin/bash
source ./scanner/pre/variables.sh
REPORT_NAME="scan-pmd-visualforce"
REPORT_PATH="$REPORT_FOLDER/$REPORT_NAME"
REPORT_CSV="$REPORT_PATH.csv"
REPORT_XML="$REPORT_PATH.xml"
REPORT_NAME="scan-pmd-visualforce.html"
REPORT_HTML="$REPORT_FOLDER/$REPORT_NAME"
PMD_CONFIG_VF="./scanner/rules/pmd-ruleset-vf.xml"
sfdx scanner:run --format csv \
sfdx scanner:run --format html \
--target $TARGET_SOURCE \
--pmdconfig $PMD_CONFIG_VF \
--engine pmd \
--outfile $REPORT_CSV
sfdx scanner:run --format junit \
--target $TARGET_SOURCE \
--pmdconfig $PMD_CONFIG_VF \
--engine pmd \
--outfile $REPORT_XML
--outfile $REPORT_HTML

0 comments on commit aee1d2c

Please sign in to comment.