Skip to content

When using CLI jlfmt, style is never taken from config file, unless switch --prioritize-config-file is given #951

@dhanak

Description

@dhanak

It is possible to define the style to be used in the config file, using style = "yas", for example. When using the CLI, however, this option is disregarded, unless --prioritize-config-file is given.

The root cause of this is that inside the main function, the CLI options are merged onto the options read from the config file. This is fine for most options, the style option, however, is always set, even if it is not given explicitly in a CLI option:

    format_options[:style] = if style_name == "default"
        DefaultStyle()
    elseif style_name == "yas"
        YASStyle()
    elseif style_name == "blue"
        BlueStyle()
    elseif style_name == "sciml"
        SciMLStyle()
    elseif style_name == "minimal"
        MinimalStyle()
    else
        return panic("unknown style: \"$style_name\"")
    end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions