Skip to content

updating summarize cli for consistency with other subcmds. - #360

Merged
keighrim merged 7 commits into
developfrom
359-summarize-cli-flags
Feb 13, 2026
Merged

updating summarize cli for consistency with other subcmds. #360
keighrim merged 7 commits into
developfrom
359-summarize-cli-flags

Conversation

@keighrim

Copy link
Copy Markdown
Member

fixes#359 .

@marcverhagen

Copy link
Copy Markdown
Contributor

Out of curiosity: what was wrong with the type hint in summarize.main?

@keighrim
keighrimforce-pushed the 359-summarize-cli-flags branch from c2c8f08 to ad5d0d3CompareFebruary 11, 2026 23:05
@keighrim

Copy link
Copy Markdown
MemberAuthor

Nothing, I guess...? Probably due to copy-paste I did from other CLI modules. I reverted the change in the new force-push.

CopilotAI 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.

Pull request overview

Aligns the mmif summarize subcommand’s CLI interface with other mmif CLI tools by standardizing input/output handling (positional input w/ STDIN support, optional output defaulting to STDOUT, and pretty printing), and centralizing stream opening/closing to avoid resource leaks.

Changes:

  • Refactors summarize to accept positional input (or STDIN), optional -o/--output (or STDOUT), and -p/--pretty.
  • Introduces open_cli_io_arg helper and migrates other CLI subcommands (describe, rewind, source) to use it.
  • Adds/updates tests and documents the standard CLI I/O pattern in CONTRIBUTING.md.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
mmif/utils/cli/__init__.pyAdds open_cli_io_arg context manager for consistent stdin/stdout/file handling across CLI modules.
mmif/utils/cli/summarize.pyUpdates summarize CLI to match conventions: positional input, optional output, pretty flag, stdin/stdout support.
mmif/utils/cli/describe.pySwitches output arg to path-like + uses open_cli_io_arg for input/output handling.
mmif/utils/cli/rewind.pySwitches MMIF_FILE/output to path-like + uses open_cli_io_arg for input/output handling.
mmif/utils/cli/source.pySwitches output to a path-like + uses open_cli_io_arg for output handling.
mmif/utils/summarizer/summary.pyAdds to_dict(), improves report() outfile flexibility, replaces debug prints with logging.
tests/test_utils_cli.pyRefactors MMIF fixtures and adds a new test suite for the updated summarize CLI behavior.
tests/mmif_examples.pyMakes sample loading path-safe via Path(__file__) instead of hard-coded relative paths.
CONTRIBUTING.mdDocuments the standardized CLI I/O argument pattern using open_cli_io_arg.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadtests/test_utils_cli.py
Comment threadmmif/utils/cli/__init__.py Outdated
Comment threadmmif/utils/cli/__init__.py
Comment threadmmif/utils/cli/summarize.py Outdated
Comment threadmmif/utils/cli/summarize.py Outdated
Comment threadCONTRIBUTING.md
@codecov

codecovBot commented Feb 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.64151% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.66%. Comparing base (503abe2) to head (c5c3d29).
⚠️ Report is 8 commits behind head on develop.

Files with missing linesPatch %Lines
mmif/utils/cli/__init__.py78.94%8 Missing ⚠️
mmif/utils/summarizer/summary.py61.90%8 Missing ⚠️
mmif/utils/cli/describe.py25.00%6 Missing ⚠️
mmif/utils/cli/rewind.py20.00%4 Missing ⚠️
mmif/utils/cli/summarize.py90.32%3 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## develop #360 +/- ##
===========================================
+ Coverage 66.58% 71.66% +5.07% 
===========================================
Files 22 22 Lines 2846 2915 +69 ===========================================
+ Hits 1895 2089 +194 + Misses 951 826 -125 
FlagCoverage Δ
unittests71.66% <72.64%> (+5.07%)⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment threadmmif/utils/cli/__init__.py Outdated
Comment threadmmif/utils/summarizer/summary.py Outdated
marcverhagen
marcverhagen previously approved these changes Feb 12, 2026
@github-project-automationgithub-project-automationBot moved this from Todo to Verifying in infraFeb 12, 2026

CopilotAI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadmmif/utils/cli/__init__.py Outdated
Comment threadmmif/utils/cli/summarize.py
Comment threadmmif/utils/cli/__init__.py Outdated

CopilotAI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadmmif/utils/cli/summarize.py
Comment threadmmif/utils/cli/__init__.py Outdated
Comment threadmmif/utils/cli/describe.py
Comment threadmmif/utils/cli/summarize.py Outdated
@keighrim
keighrimforce-pushed the 359-summarize-cli-flags branch from f819278 to 6c09468CompareFebruary 13, 2026 00:25

CopilotAI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadtests/test_utils_cli.py
Comment threadmmif/utils/cli/summarize.py Outdated
Comment threadmmif/utils/cli/summarize.py
Comment threadtests/test_utils_cli.py
@keighrim
keighrimforce-pushed the 359-summarize-cli-flags branch from 6c09468 to c5c3d29CompareFebruary 13, 2026 01:16
@keighrim
keighrim merged commit a6db461 into developFeb 13, 2026
6 checks passed
@github-project-automationgithub-project-automationBot moved this from Verifying to Done in infraFeb 13, 2026
@keighrim
keighrim deleted the 359-summarize-cli-flags branch February 14, 2026 01:23
@keighrimkeighrim mentioned this pull request Mar 10, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

summarize CLI inconsistent with other subcommands

4 participants

@keighrim@marcverhagen@clams-bot