Re: Re: Installation

Tor Norbye <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.tasklist.devel
Organization Sun Microsystems, Inc
Message-ID <1056066529.5763.15.camel@proto>
On Thu, 2003-06-19 at 13:58, Tor Norbye wrote:
> On Thu, 2003-06-19 at 13:34, Vincent Brabant wrote:
> > I finded the blog concerning checkstyle.
> > Have a nice reading
> > 
> > http://freeroller.net/page/oburn
> 
> Interesting. I see some rules I'd like to run on my code that are
> not in PMD. I might give integrating it a shot.
> 
> -- Tor
> 

I've done a preliminary integration of checkstyle.
It does what you'd expect - like PMD, when the module
is enabled it generates suggestions in the suggestion
window for each of the rule violations found by checkstyle.

I have not yet implemented any "automatic fix" features like
those I did for PMD.

You can get the module here:
  http://www.norbye.org/tor/tasklist-checkstyle.nbm

It's there, and not in CVS, because it includes the
checkstyle binaries, which are using LGPL, not SPL, so
they cannot be hosted on netbeans.org in unscrambled
form (and to scramble it I need legal approval. This
takes about a month.)

I've hit a major snag though.

Checkstyle does NOT have an API for processing input
via a stream - it wants to read the files directly!!!
That's a big problem for me, since I want to have checkstyle
run on the current (possibly and typically unsaved content),
not the on-disk version!

So, you need to save your file after editing to get 
your edits checked.

That's clearly unacceptable, so I have three possibilities:

1) Convince the checkstyle author(s) to modify the API
   to be less File centric; their internal APIs should just 
   use Reader or InputStream, and then they can wrap an
   API compatibility layer on top of that which given a
   File opens a FileReader and continues internally using
   the reader.

2) Do this myself, and ship a modified version of checkstyle
   with our module. Yuck, that causes lots of license problems.

3) Before processing, write the contents to a temporary file
   and point checkstyle to the temp file instead. Yuck yuck
   double yuck.

Gotta run shortly - I have plans for the evening. I'll commit
my source code to cvs though in case anybody wants to play
with it or contribute.

-- Tor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.