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

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

Open
tcrawford-figure opened this issue Jan 31, 2024 · 0 comments
Open

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

tcrawford-figure opened this issue Jan 31, 2024 · 0 comments

Comments

@tcrawford-figure
Copy link
Contributor

tcrawford-figure commented Jan 31, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants