What is CHECKSTYLE: OFF found in the Java source? Checkstyle to know from

If you're not a hyper beginner, you shouldn't wonder too much ... Checkstyle was a good idea.

The beginning was CHECKSTYLE: OFF.

When I was looking at the Java source, I found something like this.

//CHECKSTYLE:OFF
Java code
//CHECKSTYLE:ON

What? this? Was the beginning.

CHECKSTYLE: OFF turns off Checkstyle.

When I went around with "Java CHECKSTYLE: OFF", it felt good from the first case.

-Case of daringly breaking the rules (Checkstyle warning suppression) --Tomoto Daisuke IT-PRESS

There was also a description in checkstye.xml in my project as described on the page!

<module name="Checker">
  <property name="severity" value="warning"/>
  <module name="TreeWalker">
    <module name="FileContentsHolder"/>
    <module name="JavadocMethod">
 <abridgement>
  <module name="SuppressionCommentFilter"/>
  <module name="SuppressWithNearbyCommentFilter">
    <property name="commentFormat" value="CHECKSTYLE IGNORE THIS LINE"/>
  </module>
</module>

So "CHECKSTYLE: OFF" is ...

You can suppress Checkstyle warnings by writing comments in your code. System.out.println(123); // CHECKSTYLE IGNORE THIS LINE Furthermore, if you want to suppress over a range of several lines, you can also write: // CHECKSTYLE:OFF System.out.println(123); System.out.println(456); System.out.println(789); // CHECKSTYLE:ON Case of daringly breaking the rules (Checkstyle warning suppression) --Tomoto Daisuke IT-PRESS

Checkstyle is a static analysis tool for checking coding standards.

Screen Shot 2017-08-09 at 0.28.20.png

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard. checkstyle – Checkstyle 8.1

Screen Shot 2017-08-09 at 0.13.21.png

You can check during program creation (Just In Time). When running on Eclipse, the check is performed every time a file is edited or added. This allows you to correct mistakes immediately after writing the code. Catalog of test tools that can be used in Eclipse (2): Static analysis tools that can be used in Eclipse-@IT

There are many coding standards in the world, but it seems that you can make your own coding standards for checking. Screen Shot 2017-08-09 at 0.20.14.png

Recommended Posts

What is CHECKSTYLE: OFF found in the Java source? Checkstyle to know from
What is ... (3 dots) found in the Java source? Variadic arguments to know from
What is the main method in Java?
What to do when you want to know the source position where the method is defined in binding.pry
Source used to get the redirect source URL in Java
What I did in the version upgrade from Ruby 2.5.2 to 2.7.1
The road from JavaScript to Java
Want to know what Ruby n is the power of 2? (Power judgment of 2)
What I did in the migration from Spring Boot 1.4 series to 2.0 series
What to do if Cloud9 is full in the Rails tutorial
What I did in the migration from Spring Boot 1.5 series to 2.0 series
What is a class in Java language (3 /?)
Java reference to understand in the figure
What is a class in Java language (1 /?)
What is a class in Java language (2 /?)
How to get the date in java
What to do if the prefix c is not bound in JSP
From Java9, the constructor of the class corresponding to primitive types is deprecated.
[Beginner] What is Docker in the first place? Easy-to-understand explanation from the basics!
[Gradle] [checkstyle] What to do if the active setting of Checkstyle is removed by "Refresh Gradle project" from Eclipse
What is JSP? ~ Let's know the basics of JSP !! ~
What is java
What is the Java Servlet / JSP MVC model?
What is different from the PHP language. [Note]
The intersection type introduced in Java 10 is amazing (?)
How to get Class from Element in Java
What is Java <>?
What is the volatile modifier for Java variables?
What is Java
[Java] Is it unnecessary to check "identity" in the implementation of the equals () method?
Androd: What to do about "The Realm is already in a write transaction in"
What to do when debugging "Source not found"
[Java] Memo on how to write the source
[Java] Something is displayed as "-0.0" in the output
Get the value from the array and find out what number it is included in
What to do when "Fail to load the JNI shared library" is displayed in Eclipse
The right way to see the tomcat source in eclipse
[Java] How to omit the private constructor in Lombok
[Java] I want to calculate the difference from the date
Tokoro I rewrote in the migration from Wicket 7 to 8
How to write Scala from the perspective of Java
[Java] How to extract the file name from the path
Which is better, Kotlin or Java in the future?
[JAVA] What is the difference between interface and abstract? ?? ??
What I got from continuing to develop open source
Java classes and instances to understand in the figure
I tried to implement the Euclidean algorithm in Java
What Java engineers need to prepare for the Java 11 release
What is the difference between Java EE and Jakarta EE?
The story that .java is also built in Unity 2018
I tried to find out what changed in Java 9
Changes from Java 8 to Java 11
Sum from Java_1 to 100
Comments in Java source
Eval Java source from Java
From Java to Ruby !!
What is Java technology?
What is Java API-java
[Java] What is flatMap?
[Java] What is JavaBeans?
[Java] What is ArrayList?