How to limit the processed files for a certain check?

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

How to limit the processed files for a certain check?

Wippermann, Peter, Vodafone DE
How to limit the processed files for a certain check?

Hi,

I've written my own check *yeah*
Now I want this check to be applied to a certain set of classes only. All these classes inherit (at least indirectly) from the same super class.

But I thought it would be easier to filter for the package respectively the path in the file system, because all these classes lie in the same package: e.g. com.company.pack

I already learned about filters, but this effects all checks and not only a single one, right?
My last guess is to add "PACKAGE" to the supported token types of the check and analyse the fully qualified path. But this seems to be awkward to me…

What would you suggest?

Best regards,
Peter
 

 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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: How to limit the processed files for a certain check?

tymieniecki
How to limit the processed files for a certain check?

HI Peter,

 

Did you manage to get your check to work. I have had endless problems with ‘Unable to instantiate check’ and frankly all I got from the checkstyle-user was to check my classpath. Problem is that is set OK as everything else works , so what am I missing ?

A constructor – tried that

The config file checkstyle-configutaion.xml – tried that

 

So any fresh Ideas gratefully accepted…

 

Regards

 

Mark Zaremba-Tymieniecki

Home: 0207 228 0119

Mob:   0789 420 8834

Skype: mark.tymieniecki

 

 

 

From: Wippermann, Peter, VF-DE [mailto:[hidden email]]
Sent: 06 June 2012 13:56
To: [hidden email]
Subject: [Checkstyle-user] How to limit the processed files for a certain check?

 

Hi,

I've written my own check *yeah*
Now I want this check to be applied to a certain set of classes only. All these classes inherit (at least indirectly) from the same super class.

But I thought it would be easier to filter for the package respectively the path in the file system, because all these classes lie in the same package: e.g. com.company.pack

I already learned about filters, but this effects all checks and not only a single one, right?
My last guess is to add "PACKAGE" to the supported token types of the check and analyse the fully qualified path. But this seems to be awkward to me…

What would you suggest?

Best regards,
Peter
 

 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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: How to limit the processed files for acertain check?

Wippermann, Peter, Vodafone DE
How to limit the processed files for a certain check?
Hi Mark,
 
yes, I got it working when executing checkstyle manually and I could even integrate it into my Sonar profile!
 
- I downloaded the checkstyle 5.5 package and unzipped it.
- Put the "test.jar"-file with my Check in the same directory.
- Executed the following command from there:
java -classpath test.jar;checkstyle-5.5-all.jar com.puppycrawl.tools.checkstyle.Main -c custom_check.xml -r .
The parameter "-r ." will audit the source files in the current directory - you will certain want to scan another directory.

To help you getting started, I will attach my test.jar and the config-file. But don't take the code seriously, as I'm still playing around. Neither is the class' name appropriate nor is it well documented. Furthermore, the check's logic is very specific. So don't care about the code, just try to get it running ;-)
 
Best regards,
Peter

 
 


Von: Mark Tymieniecki [mailto:[hidden email]]
Gesendet: Mittwoch, 6. Juni 2012 15:36
An: [hidden email]
Betreff: Re: [Checkstyle-user] How to limit the processed files for acertain check?

HI Peter,

 

Did you manage to get your check to work. I have had endless problems with ‘Unable to instantiate check’ and frankly all I got from the checkstyle-user was to check my classpath. Problem is that is set OK as everything else works , so what am I missing ?

A constructor – tried that

The config file checkstyle-configutaion.xml – tried that

 

So any fresh Ideas gratefully accepted…

 

Regards

 

Mark Zaremba-Tymieniecki

Home: 0207 228 0119

Mob:   0789 420 8834

Skype: mark.tymieniecki

 

 

 

From: Wippermann, Peter 

Sent: 06 June 2012 13:56
To: [hidden email]
Subject: [Checkstyle-user] How to limit the processed files for a certain check?

 

Hi,

I've written my own check *yeah*
Now I want this check to be applied to a certain set of classes only. All these classes inherit (at least indirectly) from the same super class.

But I thought it would be easier to filter for the package respectively the path in the file system, because all these classes lie in the same package: e.g. com.company.pack

I already learned about filters, but this effects all checks and not only a single one, right?
My last guess is to add "PACKAGE" to the supported token types of the check and analyse the fully qualified path. But this seems to be awkward to me…

What would you suggest?

Best regards,
Peter
 

 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user

custom_check.xml (678 bytes) Download Attachment
test.jar (4K) Download Attachment
Loading...