Skip to content

#127: Refactored class ParameterFormatters and docstrings#128

Merged
ckunki merged 15 commits intomainfrom
refactoring/127-Refactored_class_ParameterFormatters_and_docstrings
Mar 3, 2026
Merged

#127: Refactored class ParameterFormatters and docstrings#128
ckunki merged 15 commits intomainfrom
refactoring/127-Refactored_class_ParameterFormatters_and_docstrings

Conversation

@ckunki
Copy link
Copy Markdown
Contributor

@ckunki ckunki commented Feb 4, 2026

Closes #127

ctx.params[parameter_name] = param_formatter.format(**kwargs) # type: ignore
The Click API allows updating customized parameters only in a callback
function. There is no way to inject them directly into the CLI, see
https://click.palletsprojects.com/en/stable/api/#click.Command.callback.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A callback is the function click is calling for a command. This is nothing special. It is the same as

@command
def my_command(...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the doc string. Please review again.

Dynamic formatting for customized Click CLI parameters.

The idea is that some of the cli parameters can be programmatically customized based
on values of other parameters and externally supplied formatters. For example a specialized
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To be honest, the new description is more cryptic than the original one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the doc string. Please review again.

@ckunki ckunki requested a deployment to manual-approval March 2, 2026 14:47 — with GitHub Actions Waiting
@ckunki ckunki deployed to manual-approval March 2, 2026 14:50 — with GitHub Actions Active
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ckunki ckunki merged commit 85a9323 into main Mar 3, 2026
26 of 27 checks passed
@ckunki ckunki deleted the refactoring/127-Refactored_class_ParameterFormatters_and_docstrings branch March 3, 2026 07:18
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.

Refactor class ParameterFormatters and docstrings

2 participants