示例#1
0
        public static void LintolFlow(string inputString, string categoryConfiguration)
        {
            var input         = InputParser.ParseInput(inputString).ToList();
            var configuration = InputParser.ParseSettings(categoryConfiguration);

            var dataSource = GetDataSource();
            var componentDetectorSupply = new ComponentDetectorSupply(dataSource);

            var inspectors = configuration.Categories
                             .SelectMany(ComponentInspectorSupply.GetInspectorsFor)
                             .ToList();

            var detectors = inspectors
                            .SelectMany(inspector => inspector.DependentComponents())
                            .Distinct()
                            .Select(componentDetectorSupply.GetDetectorFor)
                            .ToList();

            var verifiers = InformationVerifierSupply.Verifiers(configuration.UseVerifiers);

            var lintol = new LintolProcess(detectors, inspectors, verifiers);

            var results = lintol.Process(input);

            var output = RootMapper.Map(results, configuration);

            OutputWriter.WriteToFile(output);
        }
示例#2
0
        public void TestInit()
        {
            _template = new PythonCodeTemplate();
            var code       = _template.TransformText();
            var rootMapper = new RootMapper(new ParserBuilder());

            rootMapper.MapElements(code);
            _mappedRoot = rootMapper.GetMappedItem();
            _mainClass  = (ClassDeclaration)_mappedRoot.ClassDeclarations.FirstOrDefault();
        }
示例#3
0
        public IActionResult Root(string root, string folders = "")
        {
            try
            {
                IEnumerable <SystemItem> fileSystemItems = null;
                RootViewModel            model           = null;
                string folderPath = folders.Replace('/', Path.DirectorySeparatorChar);
                fileSystemItems = this.systemFilesService.ScanDirectory(Path.Combine(this.GetRootDirectory(root), folderPath), this.GetRootDirectory(root));
                model           = RootMapper.Map(folderPath, fileSystemItems);

                model.Root = root.ToFirstUpper();
                this.InitializeNavigationActions(this.BuildNavigationActions(folders, root));

                return(this.View("Root", model));
            }
            catch (Exception)
            {
                return(this.NotFound());
            }
        }
示例#4
0
        public async Task <IActionResult> PrivateRoot(string[] folders = null)
        {
            IEnumerable <FileSystemItem> fileSystemItems = null;
            RootViewModel model = null;

            if (folders == null)
            {
                fileSystemItems = await this.fileSystemService.ScanPrivateDirectoryAsync();

                model = RootMapper.Map("Private Root", fileSystemItems);
            }
            else
            {
                string folderPath = string.Join("\\", folders);
                fileSystemItems = await this.fileSystemService.ScanDirectoryAsync(Path.Combine(this.fileSystemService.PrivateRootDirectory, folderPath), this.fileSystemService.PrivateRootDirectory);

                model = RootMapper.Map(folderPath, fileSystemItems);
            }

            model.Root = "Private";
            return(View("Root", model));
        }