Skip to content

Add Tutorial: Setting Up Checkstyle in IntelliJ #152

@arshinsikka

Description

@arshinsikka

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

  1. Prerequisites

    • Java and Gradle project already opened in IntelliJ
    • Checkstyle config files (checkstyle.xml and suppressions.xml) placed in config/checkstyle/
    • Ideally reuse config files from AB3
  2. Installing the Checkstyle Plugin

    • Show how to install Checkstyle-IDEA from IntelliJ’s Plugins Marketplace
    • Restart IntelliJ after installing
  3. 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
  4. Viewing Violations

    • Violations appear in the Problems tab or highlighted in-editor
    • Screenshot showing an example (e.g., wildcard import warning)
  5. (Optional) Exclude Specific Files/Packages

    • Brief mention of suppressions.xml and how to link it in the config
  6. Adding .idea and related folders to .gitignore

    • To avoid committing IDE-specific configs
  7. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions