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

refactor: extract report data object and formatters #1202

Merged
merged 7 commits into from
Aug 29, 2023

Conversation

elsapet
Copy link
Contributor

@elsapet elsapet commented Aug 22, 2023

Description

Refactoring to further separate report data from report format

Main points:

  • Introduce a ReportData object that holds any data needed for the various report formats
  • Extract formatters for each report type, and move bulk of the formatting work out of run.go

Minor points:

  • Rename security result to security finding

Closes #1201

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

@elsapet elsapet force-pushed the feat/refactor-report-output-process branch from e751195 to e943c64 Compare August 23, 2023 10:10
@elsapet elsapet changed the title WIP refactor: extract report data object and formatters Aug 23, 2023
@elsapet elsapet force-pushed the feat/refactor-report-output-process branch 10 times, most recently from 9c2173d to 33977ef Compare August 25, 2023 07:34
@elsapet elsapet marked this pull request as ready for review August 25, 2023 07:34
@elsapet elsapet requested review from didroe and gotbadger August 25, 2023 07:34
@elsapet elsapet force-pushed the feat/refactor-report-output-process branch 2 times, most recently from 99a7a02 to ba8f94a Compare August 25, 2023 07:48
Copy link
Collaborator

@cfabianski cfabianski left a comment

Choose a reason for hiding this comment

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

Feels like a massive improvement already! 👍

pkg/report/output/dataflow/formatter.go Outdated Show resolved Hide resolved
pkg/report/output/detectors/formatter.go Outdated Show resolved Hide resolved
pkg/report/output/privacy/formatter.go Show resolved Hide resolved
pkg/report/output/saas/formatter.go Outdated Show resolved Hide resolved
Copy link
Contributor

@didroe didroe left a comment

Choose a reason for hiding this comment

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

Nice work! ❤️

pkg/report/output/detectors/formatter.go Outdated Show resolved Hide resolved
pkg/report/output/detectors/formatter.go Outdated Show resolved Hide resolved
pkg/report/output/output.go Outdated Show resolved Hide resolved
pkg/report/output/output.go Outdated Show resolved Hide resolved
@elsapet elsapet force-pushed the feat/refactor-report-output-process branch from 9941cda to 5c8cb6f Compare August 28, 2023 14:57
@elsapet elsapet force-pushed the feat/refactor-report-output-process branch from a5a8ded to 8f77983 Compare August 28, 2023 15:32
@elsapet elsapet merged commit e51e018 into main Aug 29, 2023
8 checks passed
@elsapet elsapet deleted the feat/refactor-report-output-process branch August 29, 2023 09:28
@elsapet elsapet mentioned this pull request Aug 29, 2023
4 tasks
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.

Refactor report output process
3 participants