@@ -33,8 +33,6 @@ class Main {
3333 static var CODE_CLIMATE_REPORTER : String = " codeclimate" ;
3434 static var SHOW_MISSING_CHECKS : Bool = false ;
3535 static var exitCode : Int ;
36- static var PATH_TYPE_RELATIVE : String = " relative" ;
37- static var PATH_TYPE_ABSOLUTE : String = " absolute" ;
3836
3937 var info : ChecksInfo ;
4038 var checker : Checker ;
@@ -146,7 +144,7 @@ class Main {
146144 function parseExcludes (config : ExcludeConfig ) {
147145 var excludes = Reflect .fields (config );
148146 var pathType = Reflect .field (config , " path" );
149- if (pathType == null ) pathType = PATH_TYPE_RELATIVE ;
147+ if (pathType == null ) pathType = RELATIVE_TO_SOURCE ;
150148 for (exclude in excludes ) {
151149 if (exclude == " path" ) continue ;
152150 createExcludeMapElement (exclude );
@@ -160,8 +158,8 @@ class Main {
160158 if (excludesMap .get (exclude ) == null ) excludesMap .set (exclude , []);
161159 }
162160
163- function updateExcludes (exclude : String , val : String , pathType : String ) {
164- if (pathType == PATH_TYPE_RELATIVE ) {
161+ function updateExcludes (exclude : String , val : String , pathType : ExcludePath ) {
162+ if (pathType == RELATIVE_TO_SOURCE ) {
165163 for (p in paths ) {
166164 // var basePath = ~/[\/\\]/.split(p)[0];
167165 var path = p + " /" + val .split (" ." ).join (" /" );
@@ -425,4 +423,10 @@ typedef CodeclimateConfig = {
425423 @:optional var include_paths : Array <String >;
426424 @:optional var config : String ;
427425 @:optional var exclude : String ;
426+ }
427+
428+ @:enum
429+ abstract ExcludePath (String ) {
430+ var RELATIVE_TO_PROJECT = " RELATIVE_TO_PROJECT" ;
431+ var RELATIVE_TO_SOURCE = " RELATIVE_TO_SOURCE" ;
428432}
0 commit comments