-
Notifications
You must be signed in to change notification settings - Fork 40
Description
We currently lack a tutorial for setting up Checkstyle in IntelliJ, even though consistent code style is a grading and PR review requirement for CS2103 projects. This issue proposes creating a new tutorial under the IntelliJ section to guide students in configuring Checkstyle correctly using the IntelliJ plugin.
This should mirror the existing VS Code - Setting up Checkstyle tutorial in structure and intent but tailored for the IntelliJ interface and plugin ecosystem.
Proposed Tutorial Structure
Checkstyle is a development tool that helps you write clean, consistent, and readable Java code by automatically checking your source code against a set of predefined coding standards.
Sections to Include
-
Prerequisites
- Java and Gradle project already opened in IntelliJ
- Checkstyle config files (
checkstyle.xmlandsuppressions.xml) placed inconfig/checkstyle/ - Ideally reuse config files from AB3
-
Installing the Checkstyle Plugin
- Show how to install Checkstyle-IDEA from IntelliJ’s Plugins Marketplace
- Restart IntelliJ after installing
-
Configuring the Plugin
- Navigate to
Preferences > Tools > Checkstyle - Add a new configuration pointing to
config/checkstyle/checkstyle.xml - Set it as the default configuration
- Ensure “Scan with every file save” is checked
- Navigate to
-
Viewing Violations
- Violations appear in the Problems tab or highlighted in-editor
- Screenshot showing an example (e.g., wildcard import warning)
-
(Optional) Exclude Specific Files/Packages
- Brief mention of
suppressions.xmland how to link it in the config
- Brief mention of
-
Adding
.ideaand related folders to.gitignore- To avoid committing IDE-specific configs
-
Troubleshooting Tips
- Restart IntelliJ
- Recheck config file paths
- Common macOS permission issues
- Missing plugin or mislinked XML file
Expected Assets
- Plugin install screenshot
- Preferences panel with Checkstyle config selected
- Example violation (e.g., wildcard import or line length)