Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken cwe_checker plugin #280

Merged
merged 4 commits into from
Jul 31, 2019
Merged

Fix broken cwe_checker plugin #280

merged 4 commits into from
Jul 31, 2019

Conversation

tbarabosch
Copy link
Contributor

Since cwe_checker changed its output format, we have to parse json instead of sexp. Good news: this makes the FACT plugin much smaller! 👍

Please do not merge before PR #32 of cwe_checker has been merged (fkie-cad/cwe_checker#32).

…ts output format, we now have to parse json instead of sexp
@tbarabosch tbarabosch requested a review from jstucke July 30, 2019 12:32
@tbarabosch tbarabosch self-assigned this Jul 30, 2019
Copy link
Member

@dorpvom dorpvom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes requested

if 'WARN' in line:
cwe_warning = cwe_parser.parse(line)
tmp[cwe_warning.name].append(cwe_warning)
j = json.loads(output)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have pre-commit set up, this would not have been allowed. Please use more semantic name to comply with coding guidelines

j = json.loads(output)
if 'warnings' in j:
for warning in j['warnings']:
tmp[warning['name']] = tmp[warning['name']] + [warning]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer the [warning, ] syntax to explicitly show warning to be one element. If warning would be a string, the string would be split into chars using the syntax without trailing comma

echo "Cleaning up"
rm -rf internal/src/_build
rm -f internal/src/cwe_checker.plugin

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also remove sexpdata installation

@dorpvom dorpvom added the under review Core dev is looking into code label Jul 31, 2019
@dorpvom dorpvom merged commit 0bf3e7c into master Jul 31, 2019
@dorpvom dorpvom deleted the cwe_check_json_support branch July 31, 2019 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under review Core dev is looking into code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants