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

Don't save kebab-case aliases in the params map #4702

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bentsherman
Copy link
Member

Close #4033

This PR attempts to resolve some quirks with the params map by separating the alias behavior from the read-only behavior. It adds an AliasMap which can be used to create a map that aliases between kebab-case and camelCase. The params map re-uses this class internally.

Still need to add some tests.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Copy link

netlify bot commented Jan 30, 2024

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit da79ec5
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/66462e4e7f39180008beb182

@bentsherman
Copy link
Member Author

Confirmed that it works with the test case in the linked issue

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman
Copy link
Member Author

Simplified it further:

  • When CLI params and params file are parsed, kebab-case params are automatically converted to camelCase. Only the camelCase key is stored.
  • The params map does not do any aliasing, since kebab-case params have already been converted, and the kebab-case variant does not need to be read

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman bentsherman changed the title Separate params aliasing into AliasMap Don't save kebab-case aliases in the params map May 16, 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
1 participant