Exemplo n.º 1
0
        private static SettingsDetails AddGlobalSettings(SettingsDetails solutionSettings, string arnolyzerHome)
        {
            if (solutionSettings.IgnoreArnolyzerHome) { return solutionSettings; }

            var globalSettings = LoadGloablSettingsIfExistsOrDefaultIfNot(arnolyzerHome);
            return SettingsDetails.Merge(solutionSettings, globalSettings);
        }
Exemplo n.º 2
0
        public SettingsDetails GetArnolyzerSettingsForProject(string filePath)
        {
            if (_mergedSettings != null) { return _mergedSettings; }

            var projectSettings = GetProjectSpecificSettings(filePath, _settingsFileName);
            var solutionSettings = AddSolutionWideSettings(filePath, projectSettings, _settingsFileName);
            _mergedSettings = AddGlobalSettings(solutionSettings, _arnolyzerHome);
            return _mergedSettings;
        }
Exemplo n.º 3
0
        private static SettingsDetails AddGlobalSettings(SettingsDetails solutionSettings, string arnolyzerHome)
        {
            if (solutionSettings.IgnoreArnolyzerHome)
            {
                return(solutionSettings);
            }

            var globalSettings = LoadGloablSettingsIfExistsOrDefaultIfNot(arnolyzerHome);

            return(SettingsDetails.Merge(solutionSettings, globalSettings));
        }
Exemplo n.º 4
0
        private static SettingsDetails AddSolutionWideSettings(string filePath,
                                                               SettingsDetails projectSettings,
                                                               string settingsFileName)
        {
            if (projectSettings.DoNotTraverse) { return projectSettings; }

            var solutionSettings = TraversePathToFindCollocatedSettings(new FileInfo(filePath).Directory,
                                                                        settingsFileName,
                                                                        ".sln");

            return SettingsDetails.Merge(projectSettings, solutionSettings);
        }
Exemplo n.º 5
0
        public SettingsDetails GetArnolyzerSettingsForProject(string filePath)
        {
            if (_mergedSettings != null)
            {
                return(_mergedSettings);
            }

            var projectSettings  = GetProjectSpecificSettings(filePath, _settingsFileName);
            var solutionSettings = AddSolutionWideSettings(filePath, projectSettings, _settingsFileName);

            _mergedSettings = AddGlobalSettings(solutionSettings, _arnolyzerHome);
            return(_mergedSettings);
        }
Exemplo n.º 6
0
        private static SettingsDetails AddSolutionWideSettings(string filePath,
                                                               SettingsDetails projectSettings,
                                                               string settingsFileName)
        {
            if (projectSettings.DoNotTraverse)
            {
                return(projectSettings);
            }

            var solutionSettings = TraversePathToFindCollocatedSettings(new FileInfo(filePath).Directory,
                                                                        settingsFileName,
                                                                        ".sln");

            return(SettingsDetails.Merge(projectSettings, solutionSettings));
        }
Exemplo n.º 7
0
 public static SettingsDetails Merge(SettingsDetails settings1, SettingsDetails settings2)
 {
     return(new SettingsDetails(settings1.DoNotTraverse || settings2.DoNotTraverse,
                                settings1.IgnoreArnolyzerHome || settings2.IgnoreArnolyzerHome,
                                settings1.IgnorePaths.Concat(settings2.IgnorePaths).ToList()));
 }
Exemplo n.º 8
0
 public static SettingsDetails Merge(SettingsDetails settings1, SettingsDetails settings2)
 {
     return new SettingsDetails(settings1.DoNotTraverse || settings2.DoNotTraverse,
                                settings1.IgnoreArnolyzerHome || settings2.IgnoreArnolyzerHome,
                                settings1.IgnorePaths.Concat(settings2.IgnorePaths).ToList());
 }
Exemplo n.º 9
0
 private static bool SyntaxTreeIsInIgoredFile(SyntaxTree syntaxTree, SettingsDetails settings) => 
     settings.IgnorePathsRegex != "" && Regex.Match(syntaxTree.FilePath, settings.IgnorePathsRegex).Success;
Exemplo n.º 10
0
 public static bool IgnoredFile(SyntaxNode node, SettingsDetails settings) => 
     SyntaxTreeIsInIgoredFile(node.SyntaxTree, settings);
Exemplo n.º 11
0
 private static bool IgnoredFile(ISymbol symbol, SettingsDetails settings) => 
     SyntaxTreeIsInIgoredFile(symbol.DeclaringSyntaxReferences[0].SyntaxTree, settings);