Ticket #1667 (closed Task: fixed)

Opened 7 years ago

Last modified 6 years ago

Create a script for automatic line-ending corrections

Reported by: fredck Owned by: wwalc
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

comment:1 Changed 7 years ago by fredck

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

comment:2 Changed 7 years ago by wwalc

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:3 Changed 7 years ago by fredck

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 7 years ago by w.olchawa

  • Keywords Discussion added

comment:5 Changed 7 years ago by w.olchawa

  • Keywords Discussion removed

comment:6 Changed 7 years ago by wwalc

  • Owner set to wwalc
  • Status changed from reopened to new

comment:7 Changed 7 years ago by wwalc

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 7 years ago by fredck

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:9 Changed 6 years ago by bitsfritz

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 6 years ago by bitsfritz

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 6 years ago by wwalc

  • Status changed from reopened to closed
  • Resolution set to fixed

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 6 years ago by wwalc

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

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