You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The filter file(.yml file) should have specific required fields for snyk-filter to work correctly. These are "customFilters", "filter", "pass" and "msg". If there is a typo in any of these snyk-filter throws a type error like below:
The error is ambiguous for the user. We need to have sanity( ! == null) check to see if the required fields exist in the .yml file. If not then throw an error to let the user know.
var ymlFileInJSON = yaml.safeLoad(fs.readFileSync(filters, 'utf8'));
customFilters = ymlFileInJSON.customFilters;
The YAML filter file used is attached for two different cases where same error is thrown(have changed the extension from .yml to .txt since GitHub won't let me attach a .yml file). First case the problem seems to be causes by indentation and second seems to be caused by incorrect field name.
The text was updated successfully, but these errors were encountered:
love-bhardwaj
changed the title
Too many indentations in a filter yaml file causes customFilters.filter variable to be null
No sanity check to see if all the required fields exists in the filters YAML file
Aug 19, 2020
The filter file(.yml file) should have specific required fields for snyk-filter to work correctly. These are "customFilters", "filter", "pass" and "msg". If there is a typo in any of these snyk-filter throws a type error like below:
The error is ambiguous for the user. We need to have sanity
( ! == null)
check to see if the required fields exist in the .yml file. If not then throw an error to let the user know.The YAML filter file used is attached for two different cases where same error is thrown(have changed the extension from .yml to .txt since GitHub won't let me attach a .yml file). First case the problem seems to be causes by indentation and second seems to be caused by incorrect field name.
Command used:
snyk-filter -i snyk_results.json -f snyk-filter-1.yml
snyk-filter-1.txt
snyk-filter-2.txt
The text was updated successfully, but these errors were encountered: