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

Config file silently ignored with unexpected property #451

Open
edbrannin opened this issue Dec 5, 2024 · 2 comments · May be fixed by #456
Open

Config file silently ignored with unexpected property #451

edbrannin opened this issue Dec 5, 2024 · 2 comments · May be fixed by #456

Comments

@edbrannin
Copy link

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
@jjvliu
Copy link

jjvliu commented 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.

@Its-Just-Nans Its-Just-Nans linked a pull request Dec 30, 2024 that will close this issue
@Its-Just-Nans
Copy link
Contributor

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

Made #456

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 a pull request may close this issue.

3 participants