Skip to content

Commit

Permalink
fix: return str placeholder in settings info if default value of sett…
Browse files Browse the repository at this point in the history
…ing is a callable (#52)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced settings information display by providing clearer
representation of callable defaults in the settings.

- **Bug Fixes**
- Improved clarity and usability of the `get_settings_info` method
output.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
johanneskoester authored Sep 9, 2024
1 parent 4e52fbe commit 0f26fe3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snakemake_interface_common/plugin_registry/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def get_settings_info(self) -> List[Dict[str, Any]]:

def fmt_default(thefield):
if thefield.default is not MISSING:
if callable(thefield.default):
return "<function>"
return thefield.default
else:
return None
Expand Down

0 comments on commit 0f26fe3

Please sign in to comment.