Code style and format configuration in eclipse

Source: Internet
Author: User
Tags checkstyle

Under eclipseCodeStyle and format Configuration

Eclipse code style, format, Configuration

Wang Yancheng (ybygjy # gmail.com ),

April August 24, 2010)

Describes Configuration Management Based on Eclipse code styles.

Code styles, formats, or code styles are very important. We often encounter changes to the original code. Then, when we read some code twice, we will find the starting point. However, some code takes a long time, and some core functional requirements are complicated. However, we still have to believe that the Code style can avoid at least reducing the time it takes for us to test code, find bugs in our own hands, and find bugs in the code of previous colleagues, it also affects our psychological subtle changes.

Basic Development Environment Information

    1. Eclipse 3.5Http://www.eclipse.org/
    2. Checkstyle5.0Http://checkstyle.sourceforge.net/
      Checkstyle is a third-party Eclipse plug-in that can effectively check the code style and give a prompt.
      Note that the checkstyle version is5.0 and later versionsBecause the configuration file I provided here is based on 5.0 export.



Home Page

Checkstyle Configuration

      Because there are too many constraints on the default code format of checkstyle itself, if you strictly follow the default constraints at the beginning to write or test the original code of the project, you will see the prompt of the full screen yellow mark, some code styles do not need to be checked for constraints. Therefore, when I use checkstyle, I constantly modify the configuration, removing some constraints and modifying some rules. Now, submit this configuration. See (Resource Information)

    • Import checkstyle Configuration
    • Export checkstyle Configuration

 



Back to Top

Eclipse code style Configuration
There are two pieces of code-style personalized configuration: Code style and code format.

    1. Code style Import and Export
    2. Import code styles

      Export Code styles

    3. Code-style Import and Export
    4. Import code format

      Export Code Format

Resource Information

    1. Style configuration fileStyle, format pack http://download.csdn.net/source/2644324


Back to Top

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.