Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#1667 closed Task (fixed)

Create a script for automatic line-ending corrections

Reported by: Frederico Caldeira Knabben Owned by: Wiktor Walc
Priority: Normal Milestone: FCKeditor 2.6
Component: General Version:
Keywords: Cc:

Description

We need a PHP script inside _dev which correct the line ending of all files in the project.

The following must be true after running it:

  • Perl files (.pl and .cgi) have LF line-ends.
  • All other files must have CRLF line-ends.

This file is supposed to be used prior releases to uniformize the code.

Change History (12)

comment:1 Changed 10 years ago by Frederico Caldeira Knabben

Additionally, this tool could remove spaces and tabs at the end of the lines.

comment:2 Changed 10 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Applied with [1359]. I'm waiting for bug reports now ;)

comment:3 Changed 10 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: closedreopened

It is nice to see when someone loves the things he do :) I would have implemented a much simpler solution (load, regex replace, save) :P Pretty cool Wiktor!

Some question / requests:

  1. Does it go recursively through the folders?
  1. It must ignore attribute hidden files and folder (like the .svn folder). Is it ok with it?
  1. Can it receive the path as a parameter in the command prompt call?
  1. Can you also append a fixlineends.bat, which runs it in the entire editor folder (../)?

comment:4 Changed 10 years ago by Wojciech Olchawa

Keywords: Discussion added

comment:5 Changed 10 years ago by Wojciech Olchawa

Keywords: Discussion removed

comment:6 Changed 10 years ago by Wiktor Walc

Owner: set to Wiktor Walc
Status: reopenednew

comment:7 Changed 10 years ago by Wiktor Walc

New version committed with [1411], [1412].

  1. It depends on the --maxdepth parameter.
  1. You mean files with "hidden" flag in Windows? There are few options to control it:
           --excluderegex=regex
           --noarchive
           --nodotfiles
           --nohidden
           --nosystem
    
  2. Yes.
  1. Done, I hope this script still works :P
php fixlineends.php --help

comment:8 Changed 10 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

Amazing job Wiktor. It worked pretty well for the first massive line endings fix (#1811).

comment:9 Changed 9 years ago by Friedrich Strohmaier

Resolution: fixed
Status: closedreopened

The *.pl and *.cgi files in FCKeditor 2.6 and nightly build still have dos style linefeeds (CRLF), so something went wrong.

Regards

Friedrich

comment:10 Changed 9 years ago by Friedrich Strohmaier

Nightly builds fromt here: http://dev.fckeditor.net/wiki/SVN contain files from 26 Nov 2007!!

I checked out SVN and everything seems to be O.K. there.

Sorry for the confusion!

Regards Friedrich

comment:11 Changed 9 years ago by Wiktor Walc

Resolution: fixed
Status: reopenedclosed

Script for automatic line-ending corrections seems to work fine, SVN contain files with valid line endings (LF).

Nightly build is created from "trunk": http://dev.fckeditor.net/browser/FCKeditor/trunk and to get the most recent version of FCKeditor from SVN, check out the trunk with:

svn co http://svn.fckeditor.net/FCKeditor/trunk fckeditorsvn

I'm closing this ticket because it is about creating script fixing line corrections, I will create a separate ticket regarding the problem with .pl and .cgi files.

comment:12 Changed 9 years ago by Wiktor Walc

For future references, I have created a separate ticket regarding issue reported by bitsfritz: #2243

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy