[GH-ISSUE #451] Config file silently ignored with unexpected property #200

Closed
opened 2026-06-08 11:26:06 +03:00 by zhus · 3 comments
Owner

Originally created by @edbrannin on GitHub (Dec 5, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/451

Steps to reproduce:

  1. Put this in ~/.config/dust/config.toml:
# ignore-directory=".git"
reverse=true
min-size="10M"
  1. Run dust
  2. Uncomment line 1 of ~/.config/dust/config.toml
  3. Run dust

Expected result:

  • One (or both) of:
    • The output is reversed (biggest-on-top) both times dust runs
    • In step 4, dust prints a warning about an invalid config-file option...
      • named ignore-directory
      • (and/or) on line 1 of ~/.config/dust/config.toml

Observed result:

  • The output is not reversed in step 4
Originally created by @edbrannin on GitHub (Dec 5, 2024). Original GitHub issue: https://github.com/bootandy/dust/issues/451 Steps to reproduce: 1. Put this in `~/.config/dust/config.toml`: ```toml # ignore-directory=".git" reverse=true min-size="10M" ``` 2. Run `dust` 3. Uncomment line 1 of `~/.config/dust/config.toml` 4. Run `dust` Expected result: - One (or both) of: - The output is reversed (biggest-on-top) both times `dust` runs - In step 4, `dust` prints a warning about an invalid config-file option... - named `ignore-directory` - (and/or) `on line 1 of ~/.config/dust/config.toml` Observed result: - The output is not reversed in step 4
zhus closed this issue 2026-06-08 11:26:06 +03:00
Author
Owner

@jjvliu commented on GitHub (Dec 19, 2024):

I confirmed this issue in the current version 1.1.1. The entire config file is ignored if I add certain key/value pairs. In my case, I tried either ~/.dust.toml or ~/.config/dust/config.toml with the same result.

For example, this works:

depth=1
threads=1
reverse=true
no-colors=true
force-colors=true # OK even with no-colors
bars-on-right=true
min-size="100M" # must be string type
screen-reader=true
skip-total=true
ignore-hidden=true # only works with dash, not underscore contrary to --help text

but trying to add any of these key/value pairs causes the entire config file to be ignored:

number-of-lines=5
full-paths=true
ignore-directory=".git"
ignore-all-in-file="dust_ignorefile"
dereference-links=true
limit-filesystem=true
apparent-size=true
no-percent-bars=true
filecount=true
ignore_hidden=true # works if underscore is changed to dash
invert-filter="\.png$"
filter="\.txt$"
file_types=true
terminal_width=80 # still fails if underscore is changed to dash

I stopped 2/3 of the way down the --help list but hopefully this helps with troubleshooting.

<!-- gh-comment-id:2552576436 --> @jjvliu commented on GitHub (Dec 19, 2024): I confirmed this issue in the current version 1.1.1. The entire config file is ignored if I add certain key/value pairs. In my case, I tried either `~/.dust.toml` or `~/.config/dust/config.toml` with the same result. For example, this works: ``` depth=1 threads=1 reverse=true no-colors=true force-colors=true # OK even with no-colors bars-on-right=true min-size="100M" # must be string type screen-reader=true skip-total=true ignore-hidden=true # only works with dash, not underscore contrary to --help text ``` but trying to add any of these key/value pairs causes the entire config file to be ignored: ``` number-of-lines=5 full-paths=true ignore-directory=".git" ignore-all-in-file="dust_ignorefile" dereference-links=true limit-filesystem=true apparent-size=true no-percent-bars=true filecount=true ignore_hidden=true # works if underscore is changed to dash invert-filter="\.png$" filter="\.txt$" file_types=true terminal_width=80 # still fails if underscore is changed to dash ``` I stopped 2/3 of the way down the `--help` list but hopefully this helps with troubleshooting.
Author
Owner

@Its-Just-Nans commented on GitHub (Dec 30, 2024):

It's because of #[serde(deny_unknown_fields)]

Made #456

<!-- gh-comment-id:2565214836 --> @Its-Just-Nans commented on GitHub (Dec 30, 2024): It's because of `#[serde(deny_unknown_fields)]` Made #456
Author
Owner

@bootandy commented on GitHub (Jan 15, 2025):

Thank you @Its-Just-Nans

<!-- gh-comment-id:2593779116 --> @bootandy commented on GitHub (Jan 15, 2025): Thank you @Its-Just-Nans
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#200