This project is designed to provide a custom Checkstyle runner that can be used to execute code style checks on Java projects using a specified set of Checkstyle rules.
These instructions will help you get your copy of the Checkstyle runner set up and running on your local machine for development and testing purposes.
You need to have the following installed on your machine:
- Java JDK 21 or higher
- Maven 3.8 or higher
-
Clone the Repository
Clone this repository to your local machine using the following command:
git clone https://github.com/ozgen/checkstyle-runner.git cd checkstyle-runner
-
Build the Project
Navigate to the project directory and run the following Maven command to build the executable JAR:
mvn clean install
This will create a
checkstyle-runner.jar
in thetarget
directory.
To run the Checkstyle checks using the built JAR, you can either use the provided bash script or run the JAR directly.
-
Using the Bash Script
Ensure the
check-style.sh
script is executable:chmod +x check-style.sh
Execute the script by passing the directory you want to check:
./check-style.sh /path/to/project
-
Using the JAR Directly
Alternatively, you can run the JAR file directly from the command line:
java -jar target/checkstyle-runner.jar /path/to/project
The Checkstyle configurations are located in the src/main/resources/checkstyle.xml
file. This file contains all the rules and configurations that Checkstyle will use to assess your Java code.