java-checkstyle

Fixes Java formatting failures by running mvn spotless:apply and verifying the result.

15.1k|2.3k|Updated Aug 1, 2021
One-click install
npx skills add https://github.com/open-metadata/OpenMetadata --skill java-checkstyle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-checkstyle
Source: https://github.com/open-metadata/OpenMetadata/tree/main/skills/java-checkstyle
Command: npx skills add https://github.com/open-metadata/OpenMetadata --skill java-checkstyle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CI builds in OpenMetadata fail when Java files are not formatted according to the Spotless Maven plugin rules, forcing developers to manually diagnose and fix checkstyle errors on pull requests.

Core Features & Use Cases

  • Automated Formatting: Runs mvn spotless:apply at the repo root to reformat all Java files according to the googleJavaFormat configuration.
  • Scoped Execution: Supports -pl <module> to format a single Maven module for faster runs, and --check to verify formatting without modifying files.
  • CI Failure Recovery: Responds directly to "Java checkstyle failed" bot comments on PRs by applying the exact fix CI expects.
  • Use Case: After editing several .java files in the openmetadata-service module, run this skill before pushing to ensure the java-checkstyle CI job passes on the first attempt.

Quick Start

Fix the Java checkstyle failure on my PR by running Spotless across the repository and committing the formatting changes.

Frequently Asked Questions about java-checkstyle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Java checkstyle failures in OpenMetadata?

Run mvn spotless:apply from the repository root to automatically reformat all Java files according to the project's Spotless configuration. Then commit the changes, which resolves the CI java-checkstyle job failure.

How to run Spotless on a single Maven module?

Use mvn -pl <module> spotless:apply, for example mvn -pl openmetadata-service spotless:apply. This scopes the formatting run to one module, making it faster when only that module changed.

What is the difference between spotless:apply and spotless:check?

spotless:apply rewrites files to match the formatting rules, while spotless:check only verifies compliance and fails without modifying anything. Use --check to confirm the tree is clean before pushing.

Why does Spotless keep reformatting my Java code?

Spotless is the source of truth for formatting in this repo, configured in the root pom.xml with googleJavaFormat and removeUnusedImports. If it rewrites your edits, your IDE formatting settings conflict with the project configuration.

Does this skill handle TypeScript or Python formatting?

No, this skill is Java-only. TypeScript formatting uses the ui-checkstyle skill with ESLint and Prettier, and Python formatting uses make py_format with ruff from the ingestion Makefile.