mitchspano / sfdx-scan-pull-request

Runs sfdx-scanner on a pull request and generates in-line comments with the findings.
Apache License 2.0
73 stars 25 forks source link

Fix severity condition #52

Closed Yurii-Zakharov closed 1 year ago

Yurii-Zakharov commented 1 year ago

Current condition check if violation.severity is equal or greater then inputs.severityThreshold from numbers perspective, but what we want is to check from severity perspective.

Severity perspective 1-5 where 1 - highest 5 - lowest https://docs.pmd-code.org/pmd-doc-6.55.0/pmd_userdocs_configuring_rules.html#message-and-priority-overriding

In main branch

In fixSeverityCondition branch

The same way sfdx scanner plugin is working. While stating:

-s, --severity-threshold=_severity-threshold_
Throws an error when violations are found with equal or greater severity than the provided value. 

They consider this severity perspective.

https://forcedotcom.github.io/sfdx-scanner/en/v3.x/scanner-commands/run/