File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -262,14 +262,18 @@ class UpdateFormatCmd(CmdBase, WithSource):
262262
263263 Updated bioimageio.yaml is rendered to the terminal if the output is None.
264264 """
265- # TODO: exclude default values (without braking discriminated unions)
266- # exclude_defaults: bool = Field(True, alias="exclude-defaults")
267- # """Exclude fields that have the default value."""
265+
266+ exclude_defaults : bool = Field (True , alias = "exclude-defaults" )
267+ """Exclude fields that have the default value (even if set explicitly) ."""
268268
269269 def run (self ):
270- updated = update_format (self .source , output = self .output )
270+ updated = update_format (
271+ self .source , output = self .output , exclude_defaults = self .exclude_defaults
272+ )
271273 updated_stream = StringIO ()
272- save_bioimageio_yaml_only (updated , updated_stream )
274+ save_bioimageio_yaml_only (
275+ updated , updated_stream , exclude_defaults = self .exclude_defaults
276+ )
273277 updated_md = f"```yaml\n { updated_stream .getvalue ()} \n ```"
274278
275279 rich_markdown = rich .markdown .Markdown (updated_md )
You can’t perform that action at this time.
0 commit comments