Skip to content

Add settings for import handling and long string reflow#267

Merged
mkurz merged 1 commit into
sbt:mainfrom
mkurz:cli-import-and-string-options
Apr 15, 2026
Merged

Add settings for import handling and long string reflow#267
mkurz merged 1 commit into
sbt:mainfrom
mkurz:cli-import-and-string-options

Conversation

@mkurz
Copy link
Copy Markdown
Member

@mkurz mkurz commented Apr 15, 2026

This adds first-class sbt settings for a few google-java-format CLI options that are not part of JavaFormatterOptions, but are still supported by the formatter when invoked through the CLI.

Added settings:

  • javafmtSortImports
  • javafmtRemoveUnusedImports
  • javafmtReflowLongStrings

These are wired through to the forked google-java-format process as:

  • --skip-sorting-imports
  • --skip-removing-unused-imports
  • --skip-reflowing-long-strings

Documentation:

  • README now documents the new settings and shows basic configuration examples

Add scripted coverage for each new setting, tested locally (also made them fail).

This keeps javafmtOptions for the upstream JavaFormatterOptions subset, while exposing the additional CLI-only options as dedicated sbt settings.

@mkurz mkurz merged commit a4402d0 into sbt:main Apr 15, 2026
2 checks passed
@mkurz mkurz deleted the cli-import-and-string-options branch April 15, 2026 14:56
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

Successfully merging this pull request may close these issues.

1 participant