views:

58

answers:

3

I use CheckStyle Plug-in for make my codes fit Java Coding Standard.The programme has lacking ability as the programme doesn't correct the errors on-time.I want to a programme which make my code correct on-time.Suppose that,I'm writing code then the plug-in warns me this line of code doesn't suitable for Java Coding Standard.In CheckStyle Plug-in every time I have to click check my codes button.It is too annoying and it makes me slow down.

Do you know any plug-in for on-time error correction?(Depends on Java Coding Standard and this programme is suitable for user-based rules)

+1  A: 

You can try to configure what actions should happen "on save" from

Window > Preferences > Java > Editor > Save Actions

It doesn't include all the checks of checkstyle, though. But don't go too overboard with forcing codestyle. It is good to have a codestyle policy, but sometimes keeping to it isn't possible. Also, sometimes it is not possible to guess how should the problem be fixed.

The idea behind these warnings is that they "teach" you to code in some manner. You shouldn't trigger a lot of warnings after a week of writing code with some policy.

Bozho
It is a good advice for formatting lines.Thanks for advice but I really search something like plug-in.It must be suitable for configuring rules.As I sad , it is for our company .All employees will use this for coding standart in serious projects.
A: 

You should try to learn to write good code in the first place and just have the tool warn you when you've done something silly rather than try and get the tool to do the job for you.

dty
It is for our company , not mine.It is gonna to be enterprise application so i can't teach over 300 employee :)
"I can't teach over 300 employee." With good documentation, you can.
Bart van Heukelom
You have 300 coders who can't write good code/adhere to a coding standard? Fire them all and re-hire 5 who can - you'll get better results.
dty
A: 

We are using a rather old version of checkstyle (4.3.3), but what yu describe works for us. As soon as I save a java file in eclipse checkstyle runs on it and reports issues in the problems list and flags them in the edit windows left margin.

What you might be missed is that fort his behaviour you need to "activate" checkstyle for the eclipse project your java files are in. To do this, goto the project properties and select "checkstyle". The resulting dialog contains a checkbox in the upper left corner which you can use to activate and deactivate checkstyle on all source files in your project.

In the same dialog you can also chose between a cimple configuration or one in which you specify the rule-set to use and which files to exclude from checking (handy in case your project contains generated code.)

rsp