Ejemplo n.º 1
0
        public void FilesFormattedSolution()
        {
            var(workspacePath, workspaceType) = WorkspacePathHelper.GetWorkspaceInfo(UnformattedSolutionFilePath);
            var options = new FormatOptions(
                workspacePath,
                workspaceType,
                LogLevel.Error,
                saveFormattedFiles: false,
                changesAreErrors: false,
                AllFileMatcher,
                reportPath: string.Empty);

            _ = CodeFormatter.FormatWorkspaceAsync(options, EmptyLogger, default).GetAwaiter().GetResult();
        }
Ejemplo n.º 2
0
        public void NoFilesFormattedProject()
        {
            var(workspacePath, workspaceType) = WorkspacePathHelper.GetWorkspaceInfo(FormattedProjectFilePath);
            var options = new FormatOptions(
                workspacePath,
                workspaceType,
                LogLevel.Error,
                saveFormattedFiles: false,
                changesAreErrors: false,
                ImmutableHashSet <string> .Empty,
                ImmutableHashSet <string> .Empty,
                reportPath: string.Empty);

            _ = CodeFormatter.FormatWorkspaceAsync(options, EmptyLogger, default).GetAwaiter().GetResult();
        }
Ejemplo n.º 3
0
        public void NoFilesFormattedSolution()
        {
            var(workspacePath, workspaceType) = WorkspacePathHelper.GetWorkspaceInfo(FormattedSolutionFilePath);
            var options = new FormatOptions(
                workspacePath,
                workspaceType,
                LogLevel.Error,
                fixCategory: FixCategory.Whitespace,
                codeStyleSeverity: DiagnosticSeverity.Error,
                analyzerSeverity: DiagnosticSeverity.Error,
                saveFormattedFiles: false,
                changesAreErrors: false,
                AllFileMatcher,
                reportPath: string.Empty,
                includeGeneratedFiles: false);

            _ = CodeFormatter.FormatWorkspaceAsync(options, EmptyLogger, default).GetAwaiter().GetResult();
        }
Ejemplo n.º 4
0
        public void NoFilesFormattedSolution()
        {
            var(workspacePath, workspaceType) = WorkspacePathHelper.GetWorkspaceInfo(FormattedSolutionFilePath);
            var options = new FormatOptions(
                workspacePath,
                workspaceType,
                NoRestore: false,
                LogLevel.Error,
                FixCategory: FixCategory.Whitespace,
                CodeStyleSeverity: DiagnosticSeverity.Error,
                AnalyzerSeverity: DiagnosticSeverity.Error,
                Diagnostics: ImmutableHashSet <string> .Empty,
                SaveFormattedFiles: false,
                ChangesAreErrors: false,
                AllFileMatcher,
                ReportPath: string.Empty,
                IncludeGeneratedFiles: false,
                BinaryLogPath: null);

            _ = CodeFormatter.FormatWorkspaceAsync(options, EmptyLogger, default).GetAwaiter().GetResult();
        }