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

Provide an option to disable import ordering or customize order #986

Open
PatrickRen opened this issue Nov 8, 2023 · 3 comments · May be fixed by #1118
Open

Provide an option to disable import ordering or customize order #986

PatrickRen opened this issue Nov 8, 2023 · 3 comments · May be fixed by #1118
Labels

Comments

@PatrickRen
Copy link

I'm working on a project (Apache Flink) using AOSP format but with customized import ordering. I manually set the order in Preferences | Editor | Code Style | Java | Imports | Import Layout, but google-java-plugin will override my settings when I use "Optimize Imports".

Is it possible to provide an option to disable the feature, or let users to customize the import order? Thanks!

@AgNS61
Copy link

AgNS61 commented Nov 11, 2023

Many teams use custom import ordering, but now this limitation drives us to use the 1.15.0 version. I hope this feature will come soon.

@nrayburn-tech
Copy link
Contributor

Should the other applicable CLI options also be exposed? This would allow using different options within the CLI and remaining consistent with the plugin. This would be beneficial when running a validation in CI to ensure code is formatted before merging. Currently, we are restricted to only what the plugin allows.

At a glance, these all look like candidates.

  • fixImportsOnly
  • sortImports
  • removeUnusedImports
  • reflowLongStrings
  • formatJavadoc

I can make a separate issue if that's preferred. Also, happy to contribute the changes if it's something that would be accepted.

@whitmabc
Copy link

whitmabc commented Oct 9, 2024

On a team that even enforces import-order as a build step, fully preventing me from using this plugin until I have the option to exclude imports from the formatting

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

Successfully merging a pull request may close this issue.

5 participants