Skip to content

shfmt - support simplifying (-s) and minifying flags (-mn) #2032

@tbcrawford

Description

@tbcrawford

shfmt supports simplifying and/or minifying shell scripts. However, there is no support provided via .editorconfig for the flags. So we'll need some additional configuration in the shfmt Gradle DSL to enable these.

My thoughts are something akin to one of the following:

Option 1

// Provides future extensible flexibility and follows the lead set by the `ktfmt` configuration
spotless {
  shell {
    shfmt().configure {
      it.minify = true
      it.simplify = true
    }
  }
}

Option 2

// If any other options become available in the future, this seems to be less extensible, however, it is very readable
spotless {
  shell {
    shfmt()
      .minify()
      .simplify()
  }
}

Note that minifying the code implies simplifying the code. So both flags can probably be true, but both flags aren't required to simplify and minify.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions