public CodeSanityValidator(ValidateCodeSanitySettings settings)
        {
            isAppveyorBuild = settings.IsAppveyorBuild;
            rootDirectory   = settings.RootDirectory;

            string ignoreFile = Path.Combine(rootDirectory, ".cfsignore");

            if (File.Exists(ignoreFile))
            {
                ignorePaths = ignorePaths.Union(File.ReadAllLines(ignoreFile)).ToArray();
            }
        }
示例#2
0
        public static void ValidateCodeSanity(this ICakeContext context, ValidateCodeSanitySettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            var codeSanityValidator = new CodeSanityValidator(settings);

            codeSanityValidator.Validate();

            if (codeSanityValidator.HasErrors)
            {
                throw new CakeException("Code sanity validation failed.");
            }
        }
示例#3
0
 public CodeSanityValidator(ValidateCodeSanitySettings settings)
 {
     isAppveyorBuild = settings.IsAppveyorBuild;
     rootDirectory   = settings.RootDirectory;
 }