예제 #1
0
        static void Main(string[] args)
        {
            var codeSanityValidator = new CodeSanityValidator(new ValidateCodeSanitySettings {
                IsAppveyorBuild = Environment.GetEnvironmentVariable("APPVEYOR")?.ToLower().Equals("true") ?? false,
                RootDirectory   = "."
            });

            codeSanityValidator.Validate();

            if (codeSanityValidator.HasErrors)
            {
                Environment.ExitCode = -1;
            }
        }
예제 #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.");
            }
        }