Re: Package and class declaration versus the directory and file names

Oliver Burn <[email protected]> Wed, 04 Aug 2010 11:12:01 +1000
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
  All available checks are listed at 
http://checkstyle.sourceforge.net/availablechecks.html

There are no checks for what you are looking for. Typically the compiler 
or IDE warns about these errors.

A check that is related is 
http://checkstyle.sourceforge.net/config_sizes.html#OuterTypeNumber 
which checks for the number of types declared at the outer  (or root) 
level in a file.

Cheers,
Oliver

On 4/08/2010 10:47 AM, Richard Walker wrote:
> I would like to do the following checks:
>
> 1. Check that the package declaration matches the directory path,
>     e.g. "package a.b.c;" means the source file must be in directory
>     a/b/c.
> 2. Check that the first class defined in a file has a name that matches
>     the filename, e.g. "class MyClass" must be defined in MyClass.java.
>
> I didn't find these checks among the Checkstyle built-ins.  Did I miss them?
> Or, has anyone else implemented them?
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm