Detect line endings

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Detect line endings

Wetzold, Robert

Hi,

 

is it possible to check which line encoding has been used in our java and xml files with checkstyle? We want to enforce unix line endings and get an error if someone checks in files with different encodings (e.g. windows or mac).

 

 

Regards, Robert


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Detect line endings

Oliver Burn
Hi,

You could write a custom check using NewlineAtEndOfFileCheck as a template for how to detect line endings.

Personally, I would recommend using the Source Control system to enforce the line-endings. I know that both Subversion and Mercurial support enforcing line-endings on commit. This is a better solution.

On Sat, Jul 9, 2011 at 03:17, Wetzold, Robert <[hidden email]> wrote:

Hi,

 

is it possible to check which line encoding has been used in our java and xml files with checkstyle? We want to enforce unix line endings and get an error if someone checks in files with different encodings (e.g. windows or mac).

 

 

Regards, Robert


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Detect line endings

Wetzold, Robert

Hi,

 

we are using git and yes although it is possible one cannot ensure in an open source scenario that everybody will have the correct local configuration. We ran into merge conflicts several times already. This is why we want to have a simple check in our Hudson Voter to signal if the line endings are ok.

 

Thank you for the tip with the EOF check. I adapted it to implement the EOL check and it works just as needed. If somebody else sees that this might be of benefit I can also clean it up a little and contribute it.

 

 

Greetings, Robert

 

From: Oliver Burn [mailto:[hidden email]]
Sent: Montag, 11. Juli 2011 03:33
To: [hidden email]
Subject: Re: [Checkstyle-user] Detect line endings

 

Hi,

You could write a custom check using NewlineAtEndOfFileCheck as a template for how to detect line endings.

Personally, I would recommend using the Source Control system to enforce the line-endings. I know that both Subversion and Mercurial support enforcing line-endings on commit. This is a better solution.

On Sat, Jul 9, 2011 at 03:17, Wetzold, Robert <[hidden email]> wrote:

Hi,

 

is it possible to check which line encoding has been used in our java and xml files with checkstyle? We want to enforce unix line endings and get an error if someone checks in files with different encodings (e.g. windows or mac).

 

 

Regards, Robert


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user

 


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Detect line endings

Oliver Burn
Patches are always welcome

On Mon, Jul 11, 2011 at 22:36, Wetzold, Robert <[hidden email]> wrote:

Hi,

 

we are using git and yes although it is possible one cannot ensure in an open source scenario that everybody will have the correct local configuration. We ran into merge conflicts several times already. This is why we want to have a simple check in our Hudson Voter to signal if the line endings are ok.

 

Thank you for the tip with the EOF check. I adapted it to implement the EOL check and it works just as needed. If somebody else sees that this might be of benefit I can also clean it up a little and contribute it.

 

 

Greetings, Robert

 

From: Oliver Burn [mailto:[hidden email]]
Sent: Montag, 11. Juli 2011 03:33
To: [hidden email]
Subject: Re: [Checkstyle-user] Detect line endings

 

Hi,

You could write a custom check using NewlineAtEndOfFileCheck as a template for how to detect line endings.

Personally, I would recommend using the Source Control system to enforce the line-endings. I know that both Subversion and Mercurial support enforcing line-endings on commit. This is a better solution.

On Sat, Jul 9, 2011 at 03:17, Wetzold, Robert <[hidden email]> wrote:

Hi,

 

is it possible to check which line encoding has been used in our java and xml files with checkstyle? We want to enforce unix line endings and get an error if someone checks in files with different encodings (e.g. windows or mac).

 

 

Regards, Robert


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user

 


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user