Using the Checkstyle plug-in in eclipse to automatically check the encoding specification __

Source: Internet
Author: User
Tags checkstyle

Checkstyle is a Java code specification checking tool. Using Checkstyle can force programmers to follow some kind of code specification. Checkstyle provides support for the Sun programming specification by default. By writing a configuration file, you can increase your own inspection specifications.

The latest version of Checkstyle is 3.5. Starting with 3.0, Checkstyle support includes code-style, code-structure, code redundancy, typical errors, and more code checking.

Checkstyle are commonly used with ant. There are a number of Checkstyle Third-party plug-ins, including Eclipse Plug-ins.

Checkstyle's official website: http://checkstyle.sourceforge.net/

Checkstyle Default supported Sun specification See: http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html, this document has a Chinese translation.

Checkstyle's download Address: http://sourceforge.net/project/showfiles.php?group_id=29721

Checkstyle Eclipse plugin Download Address: Http://prdownloads.sourceforge.net/eclipse-cs/com.atlassw.tools.eclipse.checkstyle_ 3.3.2.0.zip?download

After you install the Checkstyle plug-in in the Eclipse environment, start the Ecslipse, where you can import and configure the Checkstyle configuration file in the preferences. Checkstyle The Sun's Java code specification is installed by default.

Information that does not conform to the Checkstyle inspection criteria appears in the issues view immediately.

You can click on the "filter" of the problem view to configure the display content.

Checkstyle's check rules are contained in XML-formatted configuration files. Checkstyle The default Sun specification Check file is: Sun_checks.xml.

The Checkstyle configuration file is composed of module. The structure of a module is a tree. The root module of the tree is checker.

Author: Yu Zhang, you can get in touch with the author through e-zhangyu@vip.sina.com.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.