Skip to content

Conversation

@jwren
Copy link
Member

@jwren jwren commented Jan 17, 2026

Formatting includes Dart / Java / Kotlin / XML / Form / Properties / JSON.

The inspections are currently the default settings from IntelliJ, but this could be iterated on if we want the repo to have the inspections enforced.

If we agree on having the repo formatted / inspected, a follow up here would be documentation of this tool and the addition of it to the presubmit to prevent regressions.

With the follow-through of formatting, and adding this to the bots, this will resolve #8098

Formatting output visible in this PR: #8715

@jwren jwren requested review from helin24 and pq January 17, 2026 16:05
IDEA_FORMAT_SCRIPT=""

if [ -n "$IDEA_HOME" ]; then
IDEA_FORMAT_SCRIPT="$IDEA_HOME/bin/format.sh"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this IDEA format.sh shared for all of us? Or is it a local file that we can modify? I'm wondering if we could have a situation where we each have separate settings and end up with conflicting corrections.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is where the IntelliJ is launched from, yes. Versioning is a question for this, as well as which dart SDK we would use.

I suspect a on the latest stable platform version would be more than sufficient, formatting and verifications also don't change that much from one version to the next.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is where the IntelliJ is launched from, yes. Versioning is a question for this, as well as which dart SDK we would use.

I suspect a on the latest stable platform version would be more than sufficient, formatting and verifications also don't change that much from one version to the next.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh I think I understand more after I read this:

The format.sh script is an executable located in the bin directory of your IntelliJ IDEA installation, used for applying the IDE's configured code style formatting to specified files or directories from the command line.

So this doesn't contain the information of what code styles we want for java, it just uses the code styles we set. But where are those from? I guess my question still remains of whether we have a spot where we set the code styles for our project, rather than potentially each of us having different settings depending on our individual configuration of IntelliJ options.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a valid concern, but I don't think it will be an issue as long as we're all on the latest stable version of the platform (currently 2025.3). The Java formatter doesn't tend to change dramatically from quarter to quarter.

If we do run into inconsistencies, we could change the script to download a specific version of IntelliJ locally—outside of the repo—and hardcode our scripts to use that one, ensuring we're all aligned.

Copy link
Member

@helin24 helin24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the question around Java code settings, I think this seems great to have.

…rom IntelliJ.

Including Dart / Java / Kotlin / XML / Form / Properties / JSON.

If we agree on having the repo formatted / inspected, a follow up here would be documenation of this tool and the addition of it to the presubmit to prevent regressions.
@jwren
Copy link
Member Author

jwren commented Jan 19, 2026

@pq & @helin24 I went through and added documentation, and stricter assertions in the verify_inspections.sh. Assuming that we agree that code should be formatted and we want to track inspections. I have follow up PRs to do the formatting, and the (most importantly) have these rules enforced by our presubmits.

@jwren jwren force-pushed the java_kotlin_format branch from fe4a2a6 to 1238f2c Compare January 19, 2026 19:32
jwren added a commit to jwren/flutter-intellij that referenced this pull request Jan 19, 2026
…cluding documentation and script support.

Follow up on flutter#8712

See flutter#8098
jwren added a commit to jwren/flutter-intellij that referenced this pull request Jan 19, 2026
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.

[process] Establish Java/Kotlin coding standards

2 participants