Пример #1
0
        public void Run()
        {
            configReader.LoadConfig(commandLineOptions.ConfigFile);

            var fragmentBuilder    = new FragmentBuilder(configReader.CompatabilityLevel);
            var ruleVisitorBuilder = new RuleVisitorBuilder(configReader, this.reporter);
            var ruleVisitor        = new SqlRuleVisitor(ruleVisitorBuilder, fragmentBuilder, reporter);

            pluginHandler = new PluginHandler(reporter);
            fileProcessor = new SqlFileProcessor(ruleVisitor, pluginHandler, reporter, new FileSystem());

            pluginHandler.ProcessPaths(configReader.GetPlugins());
            var response = commandLineOptionHandler.Handle(new CommandLineRequestMessage(commandLineOptions));

            if (response.ShouldLint)
            {
                fileProcessor.ProcessList(commandLineOptions.LintPath);
            }

            if (fileProcessor.FileCount > 0)
            {
                reporter.ReportResults(timer.Stop(), fileProcessor.FileCount);
            }

            if (!response.Success)
            {
                Environment.ExitCode = 1;
            }
        }
Пример #2
0
        public void Run()
        {
            configReader.LoadConfig(commandLineOptions.ConfigFile);
            pluginHandler.ProcessPaths(configReader.GetPlugins());
            commandLineOptionHandler.HandleCommandLineOptions(commandLineOptions);
            fileProcessor.ProcessList(commandLineOptions.LintPath);

            if (fileProcessor.FileCount > 0)
            {
                reporter.ReportResults(timer.Stop(), fileProcessor.FileCount);
            }
        }
Пример #3
0
        public void Run()
        {
            _configReader.LoadConfig(_commandLineOptions.ConfigFile);
            _pluginHandler.ProcessPaths(_configReader.GetPlugins());
            _commandLineOptionHandler.HandleCommandLineOptions(_commandLineOptions);
            _fileProcessor.ProcessList(_commandLineOptions.LintPath);

            if (_fileProcessor.FileCount > 0)
            {
                _reporter.ReportResults(_timer.Stop(), _fileProcessor.FileCount);
            }
        }
Пример #4
0
        public void Run()
        {
            configReader.LoadConfig(commandLineOptions.ConfigFile);

            var          fragmentBuilder    = new FragmentBuilder(configReader.CompatabilityLevel);
            var          ruleVisitorBuilder = new RuleVisitorBuilder(configReader, this.reporter);
            IRuleVisitor ruleVisitor        = new SqlRuleVisitor(ruleVisitorBuilder, fragmentBuilder, reporter);

            pluginHandler = new PluginHandler(reporter);
            fileProcessor = new SqlFileProcessor(ruleVisitor, pluginHandler, reporter, new FileSystem());

            pluginHandler.ProcessPaths(configReader.GetPlugins());
            commandLineOptionHandler.HandleCommandLineOptions(commandLineOptions);
            fileProcessor.ProcessList(commandLineOptions.LintPath);

            if (fileProcessor.FileCount > 0)
            {
                reporter.ReportResults(timer.Stop(), fileProcessor.FileCount);
            }
        }