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

--reflow_property_chains does not work #592

Open
baryluk opened this issue Oct 20, 2023 · 3 comments
Open

--reflow_property_chains does not work #592

baryluk opened this issue Oct 20, 2023 · 3 comments

Comments

@baryluk
Copy link

baryluk commented Oct 20, 2023

user@debian:~$ DC=ldmd2 dub run dfmt -- --reflow_property_chains=conditional_newline /dev/null #
Building package dfmt in /home/user/.dub/packages/dfmt-0.15.1/dfmt/
Performing "debug" build using /usr/bin/ldmd2 for x86_64.
libdparse 0.23.2: target for configuration "library" is up to date.
dfmt 0.15.1: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running .dub/packages/dfmt-0.15.1/dfmt/bin/dfmt --reflow_property_chains=conditional_newline /dev/null
Invalid argument
Program exited with code 1

but it should according to --help

user@debian:~$ dub run --vquiet dfmt -- -h
dfmt v0.15.1-debug
https://github.com/dlang-community/dfmt

Options:
    --help, -h          Print this help message
    --inplace, -i       Edit files in place
    --config, -c    Path to directory to load .editorconfig file from.
    --version           Print the version number and then exit

Formatting Options:
    --align_switch_statements
    --brace_style               (allman|otbs|stroustrup|knr)
    --end_of_line               (lf|cr|crlf)
    --indent_size
    --indent_style, -t          (tab|space)
    --keep_line_breaks
    --soft_max_line_length
    --max_line_length
    --outdent_attributes
    --space_after_cast
    --space_before_function_parameters
    --selective_import_space
    --single_template_constraint_indent
    --split_operator_at_line_end
    --compact_labeled_statements
    --template_constraint_style
    --space_before_aa_colon
    --single_indent
    --reflow_property_chains
        (conditional_newline_indent|conditional_newline|always_newline|always_newline_indent)
@baryluk
Copy link
Author

baryluk commented Oct 20, 2023

Actually many more are broken:

user@debian:~$ dub run --vquiet dfmt -- --brace_style=otbs --indent_size=2 --split_operator_at_line_end  example.d 
Invalid argument
user@debian:~$ dub run --vquiet dfmt -- --brace_style=otbs --indent_size=2 --single_template_constraint_indent  example.d
Invalid argument
user@debian:~$ dub run --vquiet dfmt -- --brace_style=otbs --indent_size=2 --selective_import_space  example.d 
Invalid argument
user@debian:~$ dub run --vquiet dfmt -- --brace_style=otbs --indent_size=2 --single_indent  example.d 
Invalid argument
user@debian:~$ 

Some do work (like --indent_size, --indent_size, --brace_style - I tested these, maybe some other also do work)

@belka-ew
Copy link
Collaborator

You have to specify values for flags, like --split_operator_at_line_end=true or --split_operator_at_line_end=false.

@baryluk
Copy link
Author

baryluk commented Oct 21, 2023

@belka-ew Ok. I do like explicit (i.e. my custom D flag parser, also requires explicit =true, =false for boolean flags by default), but --help output should reflect this better.

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

No branches or pull requests

2 participants