Skip to content

Conversation

@desilinguist
Copy link
Collaborator

@desilinguist desilinguist commented Aug 7, 2023

As #598 states, changes to the prompt_toolkit library prevent auto-generated configuration files(both interactive and batch) from being redirected to files.

This PR:

  • Adds the --output or -o option when generating configuration files.
    • If not specified, configs are printed to screen just like before.
    • Interactive messages show the name of the output file being written to.
  • Updated documentation text and images to demonstrate the new --output option.
  • Add new tests for --output option to test_cli.py.
  • Refactor test_utils.TestSetupRsmCmdParser to add support for --output option and to use test generators instead of individual functions.
  • Fix buggy rsmexplain unit test and test data file.

To review this

  • Check out and install this branch into your environment. Run the <tool> generate --output <file> or <tool> generate --interactive --output <file> commands with various other options (--subgroups, --quiet, etc.) to check that everything works as expected.
  • Confirm that the documentation looks okay.

Closes #598

- Users can specify `--output` to write to specific files.
- If not specified, configs are printed to screen just like before.
- Interactive messages show the name of the output file being written to.
Also, fix a logging bug in `rsmexplain`.
- Use test generators to test all possible combinations instead of individual test functions.
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Patch coverage: 94.44% and project coverage change: -0.03% ⚠️

Comparison is base (9e0343c) 95.82% compared to head (552327e) 95.80%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #640      +/-   ##
==========================================
- Coverage   95.82%   95.80%   -0.03%     
==========================================
  Files          32       32              
  Lines        4430     4432       +2     
==========================================
+ Hits         4245     4246       +1     
- Misses        185      186       +1     
Files Changed Coverage Δ
rsmtool/utils/commandline.py 96.76% <75.00%> (-0.38%) ⬇️
rsmtool/rsmcompare.py 95.00% <100.00%> (ø)
rsmtool/rsmeval.py 97.89% <100.00%> (ø)
rsmtool/rsmexplain.py 92.15% <100.00%> (-0.04%) ⬇️
rsmtool/rsmpredict.py 99.35% <100.00%> (ø)
rsmtool/rsmsummarize.py 97.84% <100.00%> (ø)
rsmtool/rsmtool.py 99.21% <100.00%> (ø)
rsmtool/rsmxval.py 98.18% <100.00%> (ø)

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

Copy link
Contributor

@tamarl08 tamarl08 left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@damien2012eng damien2012eng left a comment

Choose a reason for hiding this comment

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

Works great!

@desilinguist desilinguist merged commit f22a6f5 into main Aug 8, 2023
@delete-merged-branch delete-merged-branch bot deleted the 598-output-file-for-interactive-generate branch August 8, 2023 14:02
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.

Cannot specify output file path when doing auto-generating configuration files

4 participants