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

DM-32986: fix option handling in butler CLI presets files #619

Merged
merged 2 commits into from Dec 17, 2021

Conversation

n8pease
Copy link
Contributor

@n8pease n8pease commented Dec 15, 2021

accept option names in the preset file,
map them to argument names before applying
them to the click.context.default_map.

also fail if an option is named in the
preset file that does not have a matching
parameter in the current command's options
or arguments.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #619 (4725cba) into main (d48bc30) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #619      +/-   ##
==========================================
+ Coverage   84.11%   84.13%   +0.02%     
==========================================
  Files         237      237              
  Lines       30280    30319      +39     
  Branches     5004     5008       +4     
==========================================
+ Hits        25469    25510      +41     
+ Misses       3666     3664       -2     
  Partials     1145     1145              
Impacted Files Coverage Δ
python/lsst/daf/butler/cli/utils.py 92.83% <100.00%> (+0.98%) ⬆️
tests/test_cliCmdConfigDump.py 97.32% <100.00%> (+0.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d48bc30...4725cba. Read the comment docs.

@timj
Copy link
Member

timj commented Dec 15, 2021

There should really be a test that the --something-something options work (with or without the leading --) to ensure that people don't have to write something_something.

@n8pease
Copy link
Contributor Author

n8pease commented Dec 15, 2021

There should really be a test that the --something-something options work (with or without the leading --) to ensure that people don't have to write something_something.

I didn't think it was needed, since the name change is based on lookups not transforming the inputs. But it's easy enough to add so I put one in.

Copy link
Member

@timj timj 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 to me.

@n8pease n8pease force-pushed the tickets/DM-32986 branch 2 times, most recently from 45bcbca to b7bee4b Compare December 16, 2021 17:17
accept option names in the preset file,
map them to argument names before applying
them to the click.context.default_map.

also fail if an option is named in the
preset file that does not have a matching
parameter in the current command's options
or arguments.
@n8pease n8pease merged commit a73f8d6 into main Dec 17, 2021
@n8pease n8pease deleted the tickets/DM-32986 branch December 17, 2021 21:30
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