Skip to content

Commit

Permalink
cmd/shfmt: Add support for minify and simplify via EditorConfig
Browse files Browse the repository at this point in the history
Closes #819.
  • Loading branch information
ColemanTom committed Feb 23, 2024
1 parent 68b762e commit 09202a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/shfmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ func propsOptions(lang syntax.LangVariant, props editorconfig.Section) {
syntax.KeepPadding(props.Get("keep_padding") == "true")(printer)
// TODO(v4): rename to func_next_line for consistency with flags
syntax.FunctionNextLine(props.Get("function_next_line") == "true")(printer)
minify_opt := minify.val || props.Get("minify") == "true"
syntax.Minify(minify_opt)(printer)
// Keep the original value if passed by CLI, or minify is enabled, or it is in the config file
simplify.val = simplify.val || minify_opt || props.Get("simplify") == "true"
}

func formatPath(path string, checkShebang bool) error {
Expand Down

0 comments on commit 09202a7

Please sign in to comment.