Quantcast

Checking for improperly namespaced code?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Checking for improperly namespaced code?

Andrew Pennebaker
Improperly namespaced code is giving our Windows developers trouble, but we don't know which code is to blame, as most of our developers use Mac, whose version of javac allows improper namespaces.

E.g., Mac javac allows package org.blah.blah.blah; in .java files that reside in src/main/java/com/blah/blah/blah/. Windows javac fails when encountering such a discrepancy.

This leads to much confusion and tearing of hair, as there is much code on our Macs that will fail to compile when we eventually try it out in Windows.

Our codebase is getting too large to check each package declaration manually. Is there was a way to configure checkstyle.xml and/or maven-checkstyle-plugin to report improper namespacing, when package declarations don't match up with the actual directory structure?

--
Cheers,

Andrew Pennebaker

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Checking for improperly namespaced code?

adrian.p.smith

Write a bash script?

 

From: Andrew Pennebaker [mailto:[hidden email]]
Sent: 06 November 2013 16:29
To: Checkstyle Users
Subject: [Checkstyle-user] Checking for improperly namespaced code?

 

Improperly namespaced code is giving our Windows developers trouble, but we don't know which code is to blame, as most of our developers use Mac, whose version of javac allows improper namespaces.

 

E.g., Mac javac allows package org.blah.blah.blah; in .java files that reside in src/main/java/com/blah/blah/blah/. Windows javac fails when encountering such a discrepancy.

 

This leads to much confusion and tearing of hair, as there is much code on our Macs that will fail to compile when we eventually try it out in Windows.

 

Our codebase is getting too large to check each package declaration manually. Is there was a way to configure checkstyle.xml and/or maven-checkstyle-plugin to report improper namespacing, when package declarations don't match up with the actual directory structure?

 

--

Cheers,

 

Andrew Pennebaker


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Checking for improperly namespaced code?

Andrew Pennebaker
A bash script is not a bad idea.

Though it would be better to have something platform independent to help Windows developers. Maybe a Java program. Best would be checkstyle rule.


On Wed, Nov 6, 2013 at 11:39 AM, <[hidden email]> wrote:

Write a bash script?

 

From: Andrew Pennebaker [mailto:[hidden email]]
Sent: 06 November 2013 16:29
To: Checkstyle Users
Subject: [Checkstyle-user] Checking for improperly namespaced code?

 

Improperly namespaced code is giving our Windows developers trouble, but we don't know which code is to blame, as most of our developers use Mac, whose version of javac allows improper namespaces.

 

E.g., Mac javac allows package org.blah.blah.blah; in .java files that reside in src/main/java/com/blah/blah/blah/. Windows javac fails when encountering such a discrepancy.

 

This leads to much confusion and tearing of hair, as there is much code on our Macs that will fail to compile when we eventually try it out in Windows.

 

Our codebase is getting too large to check each package declaration manually. Is there was a way to configure checkstyle.xml and/or maven-checkstyle-plugin to report improper namespacing, when package declarations don't match up with the actual directory structure?

 

--

Cheers,

 

Andrew Pennebaker


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




--
Cheers,

Andrew Pennebaker

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Checking for improperly namespaced code?

Oliver Burn


On Thu, Nov 7, 2013 at 5:22 AM, Andrew Pennebaker <[hidden email]> wrote:
A bash script is not a bad idea.

Though it would be better to have something platform independent to help Windows developers. Maybe a Java program. Best would be checkstyle rule.


On Wed, Nov 6, 2013 at 11:39 AM, <[hidden email]> wrote:

Write a bash script?

 

From: Andrew Pennebaker [mailto:[hidden email]]
Sent: 06 November 2013 16:29
To: Checkstyle Users
Subject: [Checkstyle-user] Checking for improperly namespaced code?

 

Improperly namespaced code is giving our Windows developers trouble, but we don't know which code is to blame, as most of our developers use Mac, whose version of javac allows improper namespaces.

 

E.g., Mac javac allows package org.blah.blah.blah; in .java files that reside in src/main/java/com/blah/blah/blah/. Windows javac fails when encountering such a discrepancy.

 

This leads to much confusion and tearing of hair, as there is much code on our Macs that will fail to compile when we eventually try it out in Windows.

 

Our codebase is getting too large to check each package declaration manually. Is there was a way to configure checkstyle.xml and/or maven-checkstyle-plugin to report improper namespacing, when package declarations don't match up with the actual directory structure?

 

--

Cheers,

 

Andrew Pennebaker


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




--
Cheers,

Andrew Pennebaker

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Checking for improperly namespaced code?

Roman Ivanov
In reply to this post by adrian.p.smith
Hi Andrew,

It could be done by Checkstyle - good idea.
Similar Check: http://checkstyle.sourceforge.net/config_misc.html#OuterTypeFilename
Code: https://github.com/checkstyle/checkstyle/blob/master/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheck.java

But right now Checkstyle project does not receive new feature requests, we are in stabilization process.

So please register issue in our sandbox project - https://github.com/sevntu-checkstyle/sevntu.checkstyle/issues?state=open and feel free with pull request.
After proper testing it will be moved main project https://github.com/checkstyle/checkstyle .

All Checkstyle new features need to be tested at experimental collector - https://github.com/sevntu-checkstyle/sevntu.checkstyle .

thanks,
Roman Ivanov

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Checking for improperly namespaced code?

Andrew Pennebaker
In reply to this post by Oliver Burn
Thanks!


On Wed, Nov 6, 2013 at 6:09 PM, Oliver Burn <[hidden email]> wrote:


On Thu, Nov 7, 2013 at 5:22 AM, Andrew Pennebaker <[hidden email]> wrote:
A bash script is not a bad idea.

Though it would be better to have something platform independent to help Windows developers. Maybe a Java program. Best would be checkstyle rule.


On Wed, Nov 6, 2013 at 11:39 AM, <[hidden email]> wrote:

Write a bash script?

 

From: Andrew Pennebaker [mailto:[hidden email]]
Sent: 06 November 2013 16:29
To: Checkstyle Users
Subject: [Checkstyle-user] Checking for improperly namespaced code?

 

Improperly namespaced code is giving our Windows developers trouble, but we don't know which code is to blame, as most of our developers use Mac, whose version of javac allows improper namespaces.

 

E.g., Mac javac allows package org.blah.blah.blah; in .java files that reside in src/main/java/com/blah/blah/blah/. Windows javac fails when encountering such a discrepancy.

 

This leads to much confusion and tearing of hair, as there is much code on our Macs that will fail to compile when we eventually try it out in Windows.

 

Our codebase is getting too large to check each package declaration manually. Is there was a way to configure checkstyle.xml and/or maven-checkstyle-plugin to report improper namespacing, when package declarations don't match up with the actual directory structure?

 

--

Cheers,

 

Andrew Pennebaker


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




--
Cheers,

Andrew Pennebaker

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




--
Cheers,

Andrew Pennebaker

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Loading...