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

Fix prettier for java files #4986

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Fix prettier for java files #4986

merged 2 commits into from
Dec 4, 2024

Conversation

zglicz
Copy link
Contributor

@zglicz zglicz commented Dec 3, 2024

npm run format hasn't been formatting java files for quite some time. Let us explicitly invoke the prettier-plugin-java to make it run.

package.json Outdated
@@ -3,8 +3,8 @@
"version": "1.0.0",
"description": "SonarJS code analyzer",
"scripts": {
"format": "prettier --write .",
"check-format": "prettier --list-different .",
"format": "prettier --write . --plugin=./node_modules/prettier-plugin-java/dist/index.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps we can create config file as described here https://github.com/jhipster/prettier-java?tab=readme-ov-file#usage instead of using CLI parameters?

@saberduck
Copy link
Contributor

@zglicz can you pls separate configuration change and the formatting into separate commits? And maybe avoid polluting the branch with rebase/merge commits? Then we can update .git-blame-ignore-revs with formatting commit sha, so blame still works nicely

Comment on lines +150 to +152
"plugins": [
"prettier-plugin-java"
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

with this setup, it also works.

@zglicz zglicz enabled auto-merge (squash) December 4, 2024 10:57
Copy link

sonarqube-next bot commented Dec 4, 2024

Quality Gate failed Quality Gate failed

Failed conditions
58.1% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube

@zglicz zglicz merged commit 01cfe53 into master Dec 4, 2024
17 of 19 checks passed
@zglicz zglicz deleted the fix-formating branch December 4, 2024 13:08
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.

2 participants