Replace pfff with flitter

This commit is contained in:
Joey Yakimowich-Payne 2018-06-04 13:03:46 +09:00
commit c8efc2a088
27 changed files with 295 additions and 293 deletions

View file

@ -6,7 +6,7 @@
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation, with the
* special exception on linking described in file license.txt.
*
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file
@ -17,18 +17,18 @@ open Common
(*****************************************************************************)
(* Prelude *)
(*****************************************************************************)
(*
(*
* Categorizing a source file according to recurring architecture "aspects"
* (really a directory structure) of a project. We often have some tests/,
* some commons/ library, some include/, etc.
*
*
* A file may belong to multiple categories at once.
*
*
* Right now the "aspects" are slightly modeled according to my
* own code and facebook flib code.
*
* This is used by codemap to colorize files. This is also used
* mainly for its AutoGenerated category in pfff -test_loc to
* mainly for its AutoGenerated category in flitter -test_loc to
* not count auto generated code in the LOC of a project. This
* can also be used in the deadcode detector to not count auto
* generated files (e.g. visitor_xxx.ml) as real users of an entity.
@ -38,7 +38,7 @@ open Common
(* Types *)
(*****************************************************************************)
(* coupling: if add category, dont forget to extend the source_archi_list
(* coupling: if add category, dont forget to extend the source_archi_list
* below
*)
type source_archi =
@ -47,7 +47,7 @@ type source_archi =
| Interface
(* I put Test and Logging together because if some dirs do not have some
* unit tests, but have some code to logs his action, then it's quite
* unit tests, but have some code to logs his action, then it's quite
* similar. Such code should be more robust and it's good to see it
* visually.
*)
@ -57,7 +57,7 @@ type source_archi =
| Core
| Utils (* utils base common *)
| Constants
| Constants
| GetSet (* mutators, accessors *)
| Configuration (* settings *)
@ -68,9 +68,9 @@ type source_archi =
| Ui (* ui render display *)
| Storage (* storage db *)
| Parsing (* scanner, parser *)
| Security
| Security
| I18n
(* todo?
(* todo?
* Memory (e.g. malloc, buffer), Fonts (font, charset)
* IO (e.g. keyboard, mouse)
* Strings (e.g. regex
@ -80,14 +80,14 @@ type source_archi =
| OS (* e.g. win32, macos, unix *)
| Network (* e.g. protocols ssh, ftp *)
| Ffi
| Ffi
| ThirdParty (* external *)
| Legacy (* legacy, deprecated *)
| AutoGenerated
| BoilerPlate
(* a project often contains itself some infrastructure to run tests or
(* a project often contains itself some infrastructure to run tests or
* benchmarks.
*)
| Unittester
@ -103,14 +103,14 @@ type source_archi =
let source_archi_list = [
Main; Init;
Main; Init;
Interface;
Test; Logging;
Core; Utils;
Configuration; Building;
Test; Logging;
Core; Utils;
Configuration; Building;
Doc; Data;
Constants;
GetSet;
Constants;
GetSet;
Ui; Storage; Parsing; Security; I18n;
Architecture; OS; Network;
Script;
@ -176,7 +176,7 @@ let find_duplicate_dirname dir =
let h = Hashtbl.create 101 in
let dups = Common2.hash_with_default (fun () -> 0) in
let rec aux path =
let rec aux path =
let subdirs = Common2.readdir_to_dir_list path +> List.sort compare in
subdirs +> List.iter (fun dir ->