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

Enforce and apply Google Java Style formatting #416

Merged
merged 51 commits into from
Dec 13, 2023

Conversation

bpkroth
Copy link
Collaborator

@bpkroth bpkroth commented Dec 8, 2023

NOTE: This builds off of #413, so that should be merged first.

Uses fmt-maven-plugin to automatically (locally) apply Google Java Style formatting via the google-java-format plugin during mvn compile time.

During CI time, it checks for incorrect formatting on files prior to compile to automatically reject failing commits so that reviewers have fewer things to nit over and code style is more standardized.

  • Those file changes are currently omitted in order to validate this part and make the PR easier to review. Will commit those once initial review is done.

This is not yet enforced by a git pre-commit however, so developers will have to add the changes that the compile stage applied after the fact.

Additionally, it adds settings for VSCode to apply these formattings during editing.

  • Similar settings for Eclipse are currently missing.

Followup PR can also exclude this squashed PR from the git blame analysis using a .git-blame-ignore-revs file

Closes #406

@bpkroth bpkroth changed the title Enforce and apply GoogleStyle for java formatting Enforce and apply Google Java Style formatting Dec 8, 2023
@bpkroth bpkroth requested a review from apavlo December 8, 2023 20:56
@bpkroth bpkroth merged commit 56e3191 into cmu-db:main Dec 13, 2023
120 of 121 checks passed
@bpkroth bpkroth deleted the java-formatting branch December 13, 2023 20:48
bpkroth added a commit to bpkroth/benchbase that referenced this pull request Dec 14, 2023
Follow-on work to cmu-db#416, this file uses a [`.git-blame-ignore-revs` file](https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view) to ignore revs that cause major reformatting changes in git blame view.
bpkroth added a commit that referenced this pull request Dec 14, 2023
bpkroth added a commit that referenced this pull request Dec 14, 2023
Follow-on work to #416, this file uses a [`.git-blame-ignore-revs` file](https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view) to ignore revs that cause major reformatting changes in git blame view.
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.

Add linting and formatting pre-commit/CI checks
1 participant