Its possible to pass parameters in Highlight Automation CLI to ignore certain directories, files and Paths.
Details
We can ignore certain directories, files and paths by passing below arguments in the HighlightAutomation.jar CLI
java -jar HighlightAutomation.jar --sourceDir <source dir absolute path> --workingDir <working directory> --companyId <companyid> --applicationId <applicationid>--ignoreDirectories “*\tests\*,*\exclude\certain\folder\*” –ignoreFiles “*.g.cs,*.spec.ts,” --login <user> --password <password> --serverUrl https://rpa.casthighlight.com/
--ignoreFiles (optional) List of regular expression to ignore file names. Separated by ",". Files matching with these patterns will be automatically excluded from the scan. Example to exclude all files containing "foo" with a .js extension: --ignoreFiles ".*foo.*\.js"
If you want to exclude all files that contain “cloud” in the file name whatever the position, independently of the file extension
--ignoreFiles ".*cloud.*"
If you have a file named “foocloud.js” and want to exclude it (independently of the file extension), use
--ignoreFiles ".*cloud"
If you have a file named “cloudfoo.js” and want to exclude it (independently of the file extension), use
--ignoreFiles “cloud.*”
In case you want to exclude a file with a specific string in the name and specific extension, since it’s a regexp, you’ll have to escape the “.” With “\” before:
-- ignoreFiles ".*cloud.*\.js"
Check out the other options in How to use the command line
--ignoreDirectories (optional) Directory name patterns to ignore during the scan (e.g. test folders, .git, etc.). Separated by ",". Source code within directories matching with these patterns will be automatically excluded from the scan.
--ignorePaths (optional) List of regular expressions to ignore paths, separated by "|". Source code within directories matching with this regexp will be automatically excluded from the scan. Note that starting ^ and ending $ are implicit and don't need to be passed in this option.
NB :
-
Highlight currently only considers ignore flags during the analysis stages but not the framework/SCA/DLL stages, so any code in directories will not be excluded in framework, binary libary, and third party csvs.
- UPDATE: with 5.5.7 and above, you can ignore items in these stages now
- ignorePaths is for a specific actual directory path match, so unless those are actual paths off the source directory, the pattern are not correct. Check if ignoreDirectories can be used instead.
Related Articles
CAST HIGHLIGHT - Analyzer - CLI - --ignoreDirectories command not excluding project for framework
Additional Resources
CAST Highlight Troubleshooting Guides
CAST Highlight Product Documentation
Zendesk Ticket Number
26671, 45366
Comments