简体   繁体   中英

Advantage of using checkstyle rather than using Eclipse built in code formatter?

Is there any functional advantage of using checkstyle instead of Eclipse own code formatter? In either case, we would add some custom rules, but it would largely be based on Sun's java code convention.

Here are some advantages for using checkstyle :

  • portable between IDEs. If you decide to use IntelliJ later, or you have a team using a variety of IDEs, you still have a way to enforce consistency.
  • better external tooling. It's much easier to integrate checkstyle with your external tools since it was really designed as a standalone framework. You can plug into your SCM as a pre-commit hook, or into your build tool, quite easily. Using Eclipse style convention you would need to write or locate a plugin to do the same thing.
  • ability of creating your own rules. Eclipse defines a large set of styles, but checkstyle has more, and you can add your own custom rules.

The advantage of Eclipse formatter/styler, of course, is that it's already built into the IDE, so if your team is already standardized on Eclipse you can get everyone up and running very quickly. But using checkstyles gives you more options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM