All Projects → jshiell → Checkstyle Idea

jshiell / Checkstyle Idea

Licence: other
CheckStyle plug-in for IntelliJ IDEA

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Checkstyle Idea

Intellij Rainbow Fart
🌈一个在你编程时持续夸你写的牛逼的扩展,可以根据代码关键字播放贴近代码意义的真人语音。Inspired by vscode-rainbow-fart
Stars: ✭ 391 (-47.02%)
Mutual labels:  intellij-plugin
Intellij Mybaitslog
用于在IDEA将Mybatis的SQL日志还原为可执行的SQL,Used to restore Mybatis SQL logs to executable SQL in IDEA,
Stars: ✭ 501 (-32.11%)
Mutual labels:  intellij-plugin
Intellij Platform Plugin Template
Template repository for creating plugins for IntelliJ Platform
Stars: ✭ 637 (-13.69%)
Mutual labels:  intellij-plugin
Stringmanipulation
IntelliJ plugin - https://plugins.jetbrains.com/plugin/2162
Stars: ✭ 400 (-45.8%)
Mutual labels:  intellij-plugin
Live Plugin
IntelliJ plugin for writing plugins at runtime
Stars: ✭ 464 (-37.13%)
Mutual labels:  intellij-plugin
Idea Php Laravel Plugin
Laravel Framework Plugin for PhpStorm / IntelliJ IDEA
Stars: ✭ 537 (-27.24%)
Mutual labels:  intellij-plugin
Intellij Rainbow Brackets
🌈Rainbow Brackets for IntelliJ based IDEs/Android Studio/HUAWEI DevEco Studio
Stars: ✭ 3,663 (+396.34%)
Mutual labels:  intellij-plugin
Robopojogenerator
IntelliJ IDEA/Android studio plugin: Json to Java and Kotlin POJO (GSON, Logan Square, Jackson, FastJSON, AutoValue, Moshi)
Stars: ✭ 668 (-9.49%)
Mutual labels:  intellij-plugin
Intellij
IntelliJ plugin for Bazel projects
Stars: ✭ 500 (-32.25%)
Mutual labels:  intellij-plugin
Scabbard
🗡 A tool to visualize Dagger 2 dependency graphs
Stars: ✭ 615 (-16.67%)
Mutual labels:  intellij-plugin
Gerrit Intellij Plugin
Gerrit Code Review Tool Integration for the IntelliJ Platform
Stars: ✭ 405 (-45.12%)
Mutual labels:  intellij-plugin
Texify Idea
LaTeX support for the IntelliJ platform by JetBrains.
Stars: ✭ 436 (-40.92%)
Mutual labels:  intellij-plugin
Bashsupport
Bash and shell script language support for JetBrains IDEs. Please refer to www.bashsupport.com/news/bashsupport-pro-1.3/ for the reasons.
Stars: ✭ 588 (-20.33%)
Mutual labels:  intellij-plugin
Gradle Static Analysis Plugin
Easy setup of static analysis tools for Android and Java projects.
Stars: ✭ 398 (-46.07%)
Mutual labels:  checkstyle
Intellij Solidity
Solidity plugin for IntelliJ
Stars: ✭ 646 (-12.47%)
Mutual labels:  intellij-plugin
Eclipsecodeformatter
IntelliJ plugin - Allows using Eclipse's code formatter directly from IntelliJ. https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter
Stars: ✭ 390 (-47.15%)
Mutual labels:  intellij-plugin
Android Starter
[Android Architecture] Android starter based on MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Android template project.
Stars: ✭ 522 (-29.27%)
Mutual labels:  checkstyle
Permissions Dispatcher Plugin
IntelliJ plugin for supporting PermissionsDispatcher
Stars: ✭ 704 (-4.61%)
Mutual labels:  intellij-plugin
Ok Gradle
IntelliJ/Android Studio plugin for searching artifacts ids of popular Java libraries.
Stars: ✭ 664 (-10.03%)
Mutual labels:  intellij-plugin
Kotlin Android Starter
[Kotlin Android] Kotlin Android starter based MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Kotlin Android project.
Stars: ✭ 589 (-20.19%)
Mutual labels:  checkstyle

CheckStyle-IDEA

© Copyright 2006-2020 CheckStyle-IDEA Contributors

Hosted on GitHub

Build Status Code Quality: Java Total Alerts

A plug-in for JetBrains' IntelliJ IDEA 2019-20 which provides real-time feedback against a given CheckStyle profile by way of an inspection.

Please note this is not an official part of Checkstyle - they neither endorse nor bear responsibility for this plugin. The logo is sourced from the Checkstyle resources repository and used under the CC BY 4.0 licence.

Released under a BSD-style licence - please see the LICENCE file for details.

Use

Once installed, a new inspection will be available in the group 'CheckStyle'. The 'Inspections' item in the preferences panel will allow you to turn this on and to configure it.

Project exceptions are treated a little oddly. Because CheckStyle demands these to be on the current classpath, errors will appear if these have not as yet been compiled. Further, because we cache the real-time checkers for performance reasons, real-time scans may continue to show the errors after a compilation. A static scan will force a reload of the Checker and should resolve this.

Configuration

Configuration is available under the Settings dialogue. This controls configuration for both the inspection and static scanning.

Configuration Files

The main configuration option is that of the CheckStyle file. Multiple CheckStyle file may be added, and swapped between by using the checkbox. Files may be added using the 'Add' button.

The Scan Test Classes checkbox will enable scanning of Java files under test source roots. If disabled, these files will be ignored.

If a custom file is being used and properties are available for definition then these will accessible using the 'Edit Properties' button.

Eclipse-CS Variable Support

The following variables will be available if you have not otherwise overridden their values:

  • basedir - mapped to the location of the current module file, or the project directory as a fallback.
  • project_loc, workspace_loc - mapped to the project directory.
  • config_loc, samedir - mapped to the directory the rules file is in, or the project directory for remote rules files (e.g. HTTP).

Third Party Checks

This tab allows you to specify any third-party checks which your configuration file makes use of. All selected directories/JAR files will be added to CheckStyle's classpath.

Copy libraries from project directory

The option "Copy libraries from project directory" will tell Checkstyle-IDEA to do the following when creating custom classloaders:

  • scan a module's classpath and select those library entries which reside somewhere below the project directory
  • copy those libraries to a separate temporary directory (normally under .idea, if there is no .idea directory, the system temp directory is used)

The internal classloaders will then use those copied libraries, thus preventing them from getting locked in the file system. Since this is mainly a problem on Windows, this feature is activated by default on Windows. If you know that all your libraries reside outside of the project (as is often the case when build tools such as Maven or Gradle are used), then you can disable this feature. Since it slows down checker creation, you might want to keep it disabled until necessary. After changing this option, it may be necessary to restart IDEA to see the effects.

Troubleshooting

If an error occurs during the check an exception will be thrown, which IDEA will then catch and display in the standard exceptions dialogue. If you're unsure as to why things are awry this would be your best bet - chances are it's a missing property or classpath pre-requisite.

Notable Extensions

sevntu.checkstyle

sevntu.checkstyle offers a number of useful checks written by students of the Sevastopol National Technical University (SevNTU). They're also kind enough to offer instructions on setting them up with this plugin.

Checkstyle Addons

Checkstyle Addons offers additional Checkstyle checks not found in other Checkstyle extensions, and it's easy to set up in Checkstyle-IDEA.

Development

Note that the plugin has been entirely developed on OS X - while it should be fine on Linux, I've no idea what result you'd get with Windows. YMMV.

The pre-requisites for the plugin are fairly light - you'll need Git and JDK 1.8.x. Make sure your JAVA_HOME environment variable is set correctly before invoking Gradle.

git clone https://github.com/jshiell/checkstyle-idea.git checkstyle-idea
cd checkstyle-idea

You can then easily build via Gradle:

./gradlew clean build

To run it in a sandboxed IDEA, run:

./gradlew runIde

To debug the plugin, import the plugin into IDEA as a Gradle project, and then use the runIdea Gradle target in debug mode.

Frequently Asked Questions

If you're on OS X, use IDEA with the bundled JVM. Otherwise, please ensure IDEA is running using Java 8 or later. Jetbrains offer a support document on this subject.

I see 'Got an exception - java.lang.RuntimeException: Unable to get class information for . (0:0)'

CheckStyle is unable to retrieve information on exceptions in your project until you have built it. Build your project in IDEA and then rescan.

Limitations

  • If you import Gradle project withs Create separate module per source set active in IDEA 2016 or above then the module source paths are truncated. This means relative paths (e.g. suppressions on src/test/.+) may not work as expected.
  • The plugin will throw exceptions if used with class files targeted at a later version than that of the JDK used by IDEA. Please run IDEA on the latest available JVM, ideally the bundled version from JetBrains where available.
  • If you change the configuration options the real-time scan will not be updated until the file is either changed or reopened.
  • We do not check if a property definition is required for a given file. Hence you can exit configuration without setting required properties. Given, however, that CheckStyle files can change without the plug-in being aware this is something we'll always have to live with to some degree.
  • CheckStyle errors and warnings from the inspection are both shown at a single level, as IDEA will only allow one warning level for an inspection.

Feedback

Any comments or bug reports are most welcome - please visit the project website on GitHub.

I need debug information!

The debug logging of the plugin is arcane and not particularly well done, for which I can only thank myself. However, if such context is needed then it can be seen by using IDEA's Help -> Debug Log Settings... and adding:

#org.infernus.idea.checkstyle

Acknowledgements

This plug-in owes its existence to both the style-overlords at work mandating compliance with a CheckStyle configuration, and the Eclipse-CS authors for making me jealous of the real-time scan support available for Eclipse.

Thanks to those who have contributed work and effort directly to this project:

And also thanks are due to the authors and contributors of:

  • Eclipse-CS, for inspiration and solutions to coding problems.
  • JetStyle, for filling the area of static scanning and also giving me inspirations on coding solutions.
  • CheckStyle, for without them we'd have merely void and chaos.
  • JetBrains, for an IDE which is worth every penny and then some.

And a big thank-you to everyone who's sent me feedback or bug reports - both are much appreciated!

Licence

This code is released under a BSD licence, as specified in the accompanying LICENCE file.

Version History

Please see the changelog.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].