changed negative file-type filters for case fixing to positive one

This commit is contained in:
Viktor Szakats
2013-04-07 17:40:05 +02:00
parent 95cccc46ad
commit fb930b3083
3 changed files with 48 additions and 108 deletions

View File

@@ -10,6 +10,12 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2013-04-07 17:39 UTC+0200 Viktor Szakats (harbour syenar.net)
* bin/check.hb
* tests/fixcase.hb
% changed negative file-type filters for case fixing to
positive one
2013-04-07 13:09 UTC+0200 Viktor Szakats (harbour syenar.net)
* bin/check.hb
* tests/fixcase.hb

View File

@@ -573,7 +573,10 @@ STATIC PROCEDURE ProcFile( cFileName )
".h" => ".c", ;
".api" => ".c", ;
".txt" => { @FixFuncCase() }, ;
".md" => ".txt", ;
".po" => ".txt", ;
".prg" => { @FixFuncCase() /*, "hbformat %1$s" */ }, ; /* NOTE: hbformat has bugs which make it unsuitable for unattended use */
".hb" => ".prg", ;
".ch" => ".prg" }
LOCAL aProc := hb_FNameExt( cFileName )
@@ -684,50 +687,11 @@ STATIC FUNCTION my_DirScanWorker( cMask, aList )
STATIC FUNCTION FixFuncCase( cFileName )
STATIC sc_hExtExceptions := { ;
".dll" =>, ;
".dxe" =>, ;
".dylib" =>, ;
".so" =>, ;
".sl" =>, ;
".zip" =>, ;
".7z" =>, ;
".exe" =>, ;
".o" =>, ;
".obj" =>, ;
".js" =>, ;
".dif" =>, ;
".exe" =>, ;
".y" =>, ;
".yyc" =>, ;
".yyh" =>, ;
".a" =>, ;
".afm" =>, ;
".bmp" =>, ;
".dat" =>, ;
".dbf" =>, ;
".exe" =>, ;
".frm" =>, ;
".gif" =>, ;
".icns" =>, ;
".ico" =>, ;
".jpg" =>, ;
".lbl" =>, ;
".lib" =>, ;
".mdb" =>, ;
".ng" =>, ;
".odt" =>, ;
".pdf" =>, ;
".pfb" =>, ;
".png" =>, ;
".sq3" =>, ;
".tif" => }
STATIC sc_hPartial := { ;
".c" =>, ;
".cpp" =>, ;
".h" =>, ;
".api" => }
".c" =>, ;
".cpp" =>, ;
".h" =>, ;
".api" => }
STATIC sc_hFileExceptions := { ;
"ChangeLog.txt" =>, ;
@@ -753,16 +717,15 @@ STATIC FUNCTION FixFuncCase( cFileName )
"pcode.txt" => }
STATIC sc_aMaskExceptions := { ;
"src/3rd/*" , ;
"contrib/3rd/*" , ;
"contrib/*/3rd/*" , ;
"contrib/xhb/thtm.prg" , ;
"contrib/hbnetio/tests/*" , ;
"extras/httpsrv/home/*" , ;
"tests/hbpptest/*" , ;
"tests/mt/*" , ;
"tests/multifnc/*" , ;
"tests/rddtest/*" }
"src/3rd/*" , ;
"contrib/3rd/*" , ;
"contrib/*/3rd/*" , ;
"contrib/hbnetio/tests/*" , ;
"extras/httpsrv/home/*" , ;
"tests/hbpptest/*" , ;
"tests/mt/*" , ;
"tests/multifnc/*" , ;
"tests/rddtest/*" }
LOCAL hAll
LOCAL cFile
@@ -776,7 +739,6 @@ STATIC FUNCTION FixFuncCase( cFileName )
LOCAL nChanged := 0
IF Empty( hb_FNameExt( cFileName ) ) .OR. ;
hb_FNameExt( cFileName ) $ sc_hExtExceptions .OR. ;
hb_FNameNameExt( cFileName ) $ sc_hFileExceptions .OR. ;
AScan( sc_aMaskExceptions, {| tmp | hb_FileMatch( StrTran( cFileName, "\", "/" ), tmp ) } ) == 0
RETURN .F.

View File

@@ -22,44 +22,17 @@
PROCEDURE Main( cFile )
STATIC sc_hExtExceptions := { ;
".dll" =>, ;
".dxe" =>, ;
".dylib" =>, ;
".so" =>, ;
".sl" =>, ;
".zip" =>, ;
".7z" =>, ;
".exe" =>, ;
".o" =>, ;
".obj" =>, ;
".js" =>, ;
".dif" =>, ;
".exe" =>, ;
".y" =>, ;
".yyc" =>, ;
".yyh" =>, ;
".a" =>, ;
".afm" =>, ;
".bmp" =>, ;
".dat" =>, ;
".dbf" =>, ;
".exe" =>, ;
".frm" =>, ;
".gif" =>, ;
".icns" =>, ;
".ico" =>, ;
".jpg" =>, ;
".lbl" =>, ;
".lib" =>, ;
".mdb" =>, ;
".ng" =>, ;
".odt" =>, ;
".pdf" =>, ;
".pfb" =>, ;
".png" =>, ;
".sq3" =>, ;
".tif" => }
STATIC sc_hTypes := { ;
".c" =>, ;
".cpp" =>, ;
".h" =>, ;
".api" =>, ;
".ch" =>, ;
".hb" =>, ;
".po" =>, ;
".prg" =>, ;
".md" =>, }
".txt" => }
STATIC sc_hFileExceptions := { ;
"ChangeLog.txt" =>, ;
@@ -85,16 +58,16 @@ PROCEDURE Main( cFile )
"pcode.txt" => }
STATIC sc_aMaskExceptions := { ;
"src/3rd/*" , ;
"contrib/3rd/*" , ;
"contrib/*/3rd/*" , ;
"contrib/xhb/thtm.prg" , ;
"contrib/hbnetio/tests/*" , ;
"extras/httpsrv/home/*" , ;
"tests/hbpptest/*" , ;
"tests/mt/*" , ;
"tests/multifnc/*" , ;
"tests/rddtest/*" }
"src/3rd/*" , ;
"contrib/3rd/*" , ;
"contrib/*/3rd/*" , ;
"contrib/xhb/thtm.prg" , ;
"contrib/hbnetio/tests/*" , ;
"extras/httpsrv/home/*" , ;
"tests/hbpptest/*" , ;
"tests/mt/*" , ;
"tests/multifnc/*" , ;
"tests/rddtest/*" }
LOCAL aFile
LOCAL cExt
@@ -114,8 +87,7 @@ PROCEDURE Main( cFile )
cOldCWD := hb_cwd( _HBROOT_ )
FOR EACH aFile IN hb_DirScan( "", hb_osFileMask() )
cExt := hb_FNameExt( aFile[ F_NAME ] )
IF ! Empty( cExt ) .AND. ;
!( cExt $ sc_hExtExceptions ) .AND. ;
IF cExt $ sc_hTypes .AND. ;
!( hb_FNameNameExt( aFile[ F_NAME ] ) $ sc_hFileExceptions ) .AND. ;
AScan( sc_aMaskExceptions, {| tmp | hb_FileMatch( StrTran( aFile[ F_NAME ], "\", "/" ), tmp ) } ) == 0
ProcFile( hAll, aFile[ F_NAME ] )
@@ -129,10 +101,10 @@ PROCEDURE Main( cFile )
STATIC PROCEDURE ProcFile( hAll, cFileName )
STATIC sc_hPartial := { ;
".c" =>, ;
".cpp" =>, ;
".h" =>, ;
".api" => }
".c" =>, ;
".cpp" =>, ;
".h" =>, ;
".api" => }
LOCAL cFile := MemoRead( cFileName )
LOCAL cFileStripped