Navigation Menu

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

Make --output-format default accessible #5476

Merged
merged 1 commit into from Mar 9, 2021
Merged

Make --output-format default accessible #5476

merged 1 commit into from Mar 9, 2021

Conversation

mih
Copy link
Member

@mih mih commented Mar 9, 2021

Running something like datalad -f default status does not actually
switch to the standard result renderer, because we use the "tailored"
one by default. As pointed out in #2481 this not only conflates two
different meanings of default, but also doesn't really make sense.

From my POV the implementation really wants "tailored" to be the default
mode, and not the "default" renderer to be enabled by default.

Instead of getting creative with new synonyms for these terms, I went
for the minimal change that achieves the desired result (make it
possible to have a command with a custom result renderer run with the
standard one instead).

I switch the default value of common_output_format to "tailored",
which already is the effective default behavior. This makes a
specification of an alternative "default" value actually switch the
renderer to the default one.

One could argue that "default" would be better named "standard"
(renderer), but I will not walk on this battle field ;-)

Closes #2481

Running something like `datalad -f default status` does not actually
switch to the standard result renderer, because we use the "tailored"
one by default. As pointed out in datalad#2481 this not only conflates two
different meanings of *default*, but also doesn't really make sense.

From my POV the implementation really wants `"tailored"` to be the default
mode, and not the "default" renderer to be enabled by default.

Instead of getting creative with new synonyms for these terms, I went
for the minimal change that achieves the desired result (make it
possible to have a command with a custom result renderer run with the
standard one instead).

I switch the default value of `common_output_format` to `"tailored"`,
which already is the effective default behavior. This makes a
specification of an alternative `"default"` value actually switch the
renderer to the default one.

One could argue that `"default"` would be better named `"standard"`
(renderer), but I will not walk on this battle field ;-)

Fixes dataladgh-2481
@mih mih added UX user experience corpse-in-basement labels Mar 9, 2021
@mih mih requested review from kyleam and bpoldrack March 9, 2021 07:39
@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #5476 (7541eac) into master (1df107a) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5476   +/-   ##
=======================================
  Coverage   89.52%   89.52%           
=======================================
  Files         296      296           
  Lines       42127    42127           
=======================================
  Hits        37716    37716           
  Misses       4411     4411           
Impacted Files Coverage Δ
datalad/cmdline/main.py 76.13% <ø> (ø)
datalad/interface/base.py 91.37% <ø> (ø)

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 1df107a...7541eac. Read the comment docs.

@yarikoptic yarikoptic added this to the 0.15.0 milestone Mar 9, 2021
Copy link
Contributor

@kyleam kyleam left a comment

Choose a reason for hiding this comment

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

Thanks for digging this one back up. Looks like a good solution to me.

@kyleam
Copy link
Contributor

kyleam commented Mar 9, 2021

One could argue that "default" would be better named "standard"
(renderer), but I will not walk on this battle field ;-)

:)

Yeah, the ship has sailed, but one could argue the option values like "default" or even "standard" are never a good idea because they describe the state of the system/option rather than the option's behavior, making it awkward and confusing to change in the future.

@mih
Copy link
Member Author

mih commented Mar 9, 2021

Thx @kyleam

@mih mih merged commit 8a65da7 into datalad:master Mar 9, 2021
@mih mih deleted the bf-2481 branch March 9, 2021 17:01
kyleam added a commit to kyleam/datalad that referenced this pull request Mar 9, 2021
When 7541eac (Make `--output-format default` accessible,
2021-03-09) switched to using "tailored" as the default for
--output-format, commands without a custom renderer were
unintentionally silenced:

  $ datalad save foo
  # nothing

  vs

  $ datalad save foo
  add(ok): foo (file)
  save(ok): . (dataset)
  action summary:
    add (ok: 1)
    save (ok: 1)

Restore that output by falling back to "default" when the renderer
isn't specified via --output-format or the command class attribute.

Fixes datalad#5476.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default result format is inaccessible via 'datalad -f default ...'
3 participants