OpenAPITools / OpenAPITools/openapi-generator

[REQ] Add GitHub Actions to Auto-Format all Java Files according to Checkstyle configuration

Open
#17,181 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

This project has a code style defined in the google_checkstyle.xml file. Checking whether the code in the Pull Requests or branches follows the project's code style and applying fixes accordingly is a tedious work.

Describe the solution you'd like

I want to use OpenRewrite's Maven Plugin to automatically format the Java files using the Checkstyle configuration file. I would also like to create a GitHub Actions to automatically run the formatter and push the changes to the branches or the PRs.

Additional context

I have implemented this feature in an Open-Source project - Drifty and the GitHub Action also pushes the formatted files to the branches or PRs as you can see below 👇
Screenshot from 2023-11-25 08-22-24
If this issue seems good to the maintainers and can add some value to the project, then, I would like to work on this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read google_checkstyle.xml and the OpenRewrite Maven Plugin documentation first to understand how the requested formatter would use the project’s Checkstyle configuration. Then define a GitHub Actions workflow that runs formatting for Java files on branches or pull requests and pushes the resulting changes. Done means the workflow formats the files consistently and updates the relevant branch or PR.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, java
Domain
build-system, ci-cd, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.