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

#214 - Restore output-type to cfn_nag #215

Merged
merged 5 commits into from
Jun 3, 2019
Merged

Conversation

jesseadams
Copy link

Closes #214

Syncs up cfn_nag and cfn_nag_scan so they use the same results renderers and have consistent output.

byronic added a commit that referenced this pull request May 30, 2019
Complies with Jesse's PR #215, adding output format option to cfn_nag
bin/cfn_nag Outdated
end

cfn_nag.render_results(aggregate_results: aggregate_results,
Copy link

Choose a reason for hiding this comment

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

doesn't this change the contract on the results?

Copy link

Choose a reason for hiding this comment

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

given we just bumped to 0.4.x, i guess it's not horrible to change the contract though.... and in the case of processing multiple explicit files via ARGF.... a good enhancement?

Copy link
Author

Choose a reason for hiding this comment

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

@erickascic This does change the result but towards consistency. I think it is a 👍

ghost pushed a commit that referenced this pull request May 31, 2019
* Refactor CLI Interface, Add Scan fail-on-warnings

[Finishes #165899506]; [Finishes #165899494]; factors out command line arguments reading; adds fail-on-warnings support to cfn_nag_scan; removes repeated code across cfn_nag_scan and cfn_nag by refactoring into an executor. Post-refactor, rubocop and testing required the following included supplmental changes: CfnNagExecutor is too large if read_cli_options is included, so factors that function out to its own file; CfnNag class is too large with the added fail_on_warnings option, refactors initialize parameters as a separate CfnNagConfig class; refactors the cfn_nag integration tests to use the new signatures

* Fix Missing validate_options Call

Fixes a missing call to validate_options in the executor; refactors to stay within the 15 line per function bounds of rubocop

* Executor Tests, Name Fixes

Adds naming corrections per @erickascic 's review; adds tests for CfnNagExecutor class at 88%

* Test Coverage Bump

Adds additional tests to get cfn_nag_executor and other introduced files to 100% coverage

* Keep cli_options Backwards Compatible

Updates cli_options to be backwards compatible -- removes alphabetical ordering, splits into two options categories for cfn_nag and cfn_nag_scan

* Factory Pattern, cleanup CfnNagExecutor arguments

Refactors cli_options and argf_supplier into a factory-pattern from lambdas; changes the CfnNagExecutor to have no initializer arguments and scan to properly have a cfn_nag_scan argument instead, for clarity

* Test Coverage

Raises Argf and Options test coverage to 100%

* Resolve Test Issues, Incorporate Eric's Changeset

Incorporates Eric's changeset from Slack; removes a test that is both no longer necessary and not working under the new changes; resolves rubocop issues

* No @ Allowed In Trollop.options

Removes @ items used in Trollop.options block -- those are unsupported and cause nil class exceptions

* Resolve Failing e2e Tests - Extraneous puts

An extraneous puts options call in cfn_nag_executor was causing failures in the e2e tests; removes

* Add output format option to cfn_nag

Complies with Jesse's PR #215, adding output format option to cfn_nag

* Rename execute_single_scan, options type, deprecated argf class

Per Eric Kascic's review, removes the Argf class (which was unused after prior changes); renames execute_single_scan execute_file_or_piped_scan since the argument can be an explicit file or piped input; changes the options type value for file/piped scans to 'file' from 'cli'
@byronic byronic merged commit 81b7ca4 into master Jun 3, 2019
@byronic byronic deleted the cfn-nag-output-format branch June 3, 2019 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --output-format back to cfn_nag
2 participants