Skip to content

refactor: Pass printer to text handler#1420

Merged
TerryHowe merged 3 commits into
oras-project:mainfrom
TerryHowe:pass-printer-to-text-handler
Jun 21, 2024
Merged

refactor: Pass printer to text handler#1420
TerryHowe merged 3 commits into
oras-project:mainfrom
TerryHowe:pass-printer-to-text-handler

Conversation

@TerryHowe

@TerryHowe TerryHowe commented Jun 20, 2024

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Pass printer object to text handler.

  • Fewer arguments to the handlers
  • Handlers use the same mutex used elsewhere

I'm going to explore the possibility of passing the printer to the json and template handler, but trying to keep this small.

@codecov

codecov Bot commented Jun 20, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.32%. Comparing base (37941a0) to head (c96490c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1420      +/-   ##
==========================================
- Coverage   85.33%   85.32%   -0.01%     
==========================================
  Files         106      106              
  Lines        3798     3810      +12     
==========================================
+ Hits         3241     3251      +10     
- Misses        333      334       +1     
- Partials      224      225       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TerryHowe TerryHowe force-pushed the pass-printer-to-text-handler branch 2 times, most recently from 1f3be32 to cf4f25f Compare June 20, 2024 15:07
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
@TerryHowe TerryHowe force-pushed the pass-printer-to-text-handler branch from cf4f25f to 0e22551 Compare June 20, 2024 15:34
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah

qweeah commented Jun 21, 2024

Copy link
Copy Markdown
Contributor

I'm going to explore the possibility of passing the printer to the json and template handler, but trying to keep this small.

Making printer implement io.Writer should help.

@qweeah qweeah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, still need other reviewer approval on the printer's implementation of io.Writer

@TerryHowe TerryHowe merged commit 145ea7a into oras-project:main Jun 21, 2024
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.

2 participants