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

feat(policies): disable color in policy report when writing to file #170

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

elsapet
Copy link
Contributor

@elsapet elsapet commented Nov 28, 2022

Description

Disable color in report when we are writing to a file (i.e. avoid special characters in report)
Also some refactoring to move policy-report-specific methods to output/policies.go where they should have been in the first place

Output file before



Policy Report

=====================================
Policy list: 

�[90m- Logger leaking
�[0m�[90m- Application level encryption missing
�[0m

�[31mCRITICAL: �[0mLogger leaking policy breach with Personal data
�[90mLogger leaks detected
�[0m
�[94mFile: �[4m../../Desktop/example/services/log_contact.rb:3�[0m
�[0m
 1 logger.info(
 2   "contact city:",
�[35m 3 �[0m�[35m  user.city,�[0m
 4 )

Output file after



Policy Report

=====================================
Policy list:

- Logger leaking
- Application level encryption missing


CRITICAL: Logger leaking policy breach with Personal data
Logger leaks detected

File: ../../Desktop/example/services/log_contact.rb:3

 1 logger.info(
 2   "contact city:",
 3   user.city,
 4 )

...

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

refactor: move policy report methods to output/policy.go
@swarmia
Copy link

swarmia bot commented Nov 28, 2022

@elsapet elsapet merged commit 8ee6c95 into main Nov 28, 2022
@elsapet elsapet deleted the AMA-3270-handle-summary-when-writing-output-to-file branch November 28, 2022 10:53
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.

None yet

2 participants