diff --git a/README.md b/README.md index 17a3c7fa8c..df99ba178f 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Options: diag[nostic] --dry-run Format files, but do not save changes to disk. --check Terminate with non-zero exit code if any files need to be formatted in the workspace. + --files The files to operate on. If none specified, all files in workspace will be operated on. --version Display version information ``` diff --git a/src/CodeFormatter.cs b/src/CodeFormatter.cs index f9762ecd29..2f8849e15b 100644 --- a/src/CodeFormatter.cs +++ b/src/CodeFormatter.cs @@ -1,10 +1,11 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeStyle; @@ -22,7 +23,7 @@ internal static class CodeFormatter { private const int MaxLoggedWorkspaceWarnings = 5; - public static async Task FormatWorkspaceAsync(ILogger logger, string solutionOrProjectPath, bool isSolution, bool logAllWorkspaceWarnings, bool saveFormattedFiles, CancellationToken cancellationToken) + public static async Task FormatWorkspaceAsync(ILogger logger, string solutionOrProjectPath, bool isSolution, bool logAllWorkspaceWarnings, bool saveFormattedFiles, string[] filesToFormat, CancellationToken cancellationToken) { logger.LogInformation(string.Format(Resources.Formatting_code_files_in_workspace_0, solutionOrProjectPath)); @@ -74,7 +75,7 @@ public static async Task FormatWorkspaceAsync(ILogger log logger.LogTrace(Resources.Workspace_loaded_in_0_ms, workspaceStopwatch.ElapsedMilliseconds); workspaceStopwatch.Restart(); - (formatResult.ExitCode, formatResult.FileCount, formatResult.FilesFormatted) = await FormatFilesInWorkspaceAsync(logger, workspace, projectPath, codingConventionsManager, saveFormattedFiles, cancellationToken).ConfigureAwait(false); + (formatResult.ExitCode, formatResult.FileCount, formatResult.FilesFormatted) = await FormatFilesInWorkspaceAsync(logger, workspace, projectPath, codingConventionsManager, saveFormattedFiles, filesToFormat, cancellationToken).ConfigureAwait(false); logger.LogDebug(Resources.Formatted_0_of_1_files_in_2_ms, formatResult.FilesFormatted, formatResult.FileCount, workspaceStopwatch.ElapsedMilliseconds); } @@ -105,7 +106,7 @@ void LogWorkspaceWarnings(object sender, WorkspaceDiagnosticEventArgs args) } } - private static async Task<(int status, int fileCount, int filesFormatted)> FormatFilesInWorkspaceAsync(ILogger logger, Workspace workspace, string projectPath, ICodingConventionsManager codingConventionsManager, bool saveFormattedFiles, CancellationToken cancellationToken) + private static async Task<(int status, int fileCount, int filesFormatted)> FormatFilesInWorkspaceAsync(ILogger logger, Workspace workspace, string projectPath, ICodingConventionsManager codingConventionsManager, bool saveFormattedFiles, string[] filesToFormat, CancellationToken cancellationToken) { var projectIds = workspace.CurrentSolution.ProjectIds.ToImmutableArray(); var optionsApplier = new EditorConfigOptionsApplier(); @@ -129,7 +130,7 @@ void LogWorkspaceWarnings(object sender, WorkspaceDiagnosticEventArgs args) logger.LogInformation(Resources.Formatting_code_files_in_project_0, project.Name); - var (formattedSolution, filesFormatted) = await FormatFilesInProjectAsync(logger, project, codingConventionsManager, optionsApplier, cancellationToken).ConfigureAwait(false); + var (formattedSolution, filesFormatted) = await FormatFilesInProjectAsync(logger, project, codingConventionsManager, optionsApplier, filesToFormat, cancellationToken).ConfigureAwait(false); totalFileCount += project.DocumentIds.Count; totalFilesFormatted += filesFormatted; if (saveFormattedFiles && !workspace.TryApplyChanges(formattedSolution)) @@ -142,7 +143,7 @@ void LogWorkspaceWarnings(object sender, WorkspaceDiagnosticEventArgs args) return (0, totalFileCount, totalFilesFormatted); } - private static async Task<(Solution solution, int filesFormatted)> FormatFilesInProjectAsync(ILogger logger, Project project, ICodingConventionsManager codingConventionsManager, EditorConfigOptionsApplier optionsApplier, CancellationToken cancellationToken) + private static async Task<(Solution solution, int filesFormatted)> FormatFilesInProjectAsync(ILogger logger, Project project, ICodingConventionsManager codingConventionsManager, EditorConfigOptionsApplier optionsApplier, string[] filesToFormat, CancellationToken cancellationToken) { var isCommentTrivia = project.Language == LanguageNames.CSharp ? IsCSharpCommentTrivia @@ -157,6 +158,16 @@ void LogWorkspaceWarnings(object sender, WorkspaceDiagnosticEventArgs args) continue; } + if (filesToFormat != null) + { + var fileInArgumentList = filesToFormat.Any(relativePath => document.FilePath.EndsWith(relativePath, StringComparison.OrdinalIgnoreCase)); + + if (!fileInArgumentList) + { + continue; + } + } + var formatTask = Task.Run(async () => { var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); diff --git a/src/Program.cs b/src/Program.cs index ebcefef64a..e406c9f0f1 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -33,13 +33,14 @@ private static async Task Main(string[] args) .AddOption(new Option(new[] { "-v", "--verbosity" }, Resources.Set_the_verbosity_level_Allowed_values_are_quiet_minimal_normal_detailed_and_diagnostic, new Argument() { Arity = ArgumentArity.ExactlyOne }.FromAmong(_verbosityLevels))) .AddOption(new Option(new[] { "--dry-run" }, Resources.Format_files_but_do_not_save_changes_to_disk, new Argument())) .AddOption(new Option(new[] { "--check" }, Resources.Terminate_with_non_zero_exit_code_if_any_files_need_to_be_formatted_in_the_workspace, new Argument())) + .AddOption(new Option(new[] { "--files" }, Resources.The_files_to_operate_on_If_none_specified_all_files_in_workspace_will_be_operated_on, new Argument(() => null))) .UseVersionOption() .Build(); return await parser.InvokeAsync(args).ConfigureAwait(false); } - public static async Task Run(string workspace, string verbosity, bool dryRun, bool check, IConsole console = null) + public static async Task Run(string workspace, string verbosity, bool dryRun, bool check, string files, IConsole console = null) { var serviceCollection = new ServiceCollection(); var logLevel = GetLogLevel(verbosity); @@ -70,6 +71,8 @@ public static async Task Run(string workspace, string verbosity, bool dryRu var workspaceDirectory = Path.GetDirectoryName(workspacePath); Environment.CurrentDirectory = workingDirectory; + var fileList = GetFileList(files); + // Since we are running as a dotnet tool we should be able to find an instance of // MSBuild in a .NET Core SDK. var msBuildInstance = Build.Locator.MSBuildLocator.QueryVisualStudioInstances().First(); @@ -88,6 +91,7 @@ public static async Task Run(string workspace, string verbosity, bool dryRu isSolution, logAllWorkspaceWarnings: logLevel == LogLevel.Trace, saveFormattedFiles: !dryRun, + filesToFormat: fileList, cancellationTokenSource.Token).ConfigureAwait(false); return GetExitCode(formatResult, check); @@ -142,5 +146,10 @@ private static void ConfigureServices(ServiceCollection serviceCollection, ICons serviceCollection.AddSingleton(new LoggerFactory().AddSimpleConsole(console, logLevel)); serviceCollection.AddLogging(); } + + internal static string[] GetFileList(string files) + { + return files?.Split(',').Select(path => Path.GetRelativePath(Environment.CurrentDirectory, path)).ToArray(); + } } } diff --git a/src/Resources.Designer.cs b/src/Resources.Designer.cs index 7d0fe78ad8..b3dfbc6cac 100644 --- a/src/Resources.Designer.cs +++ b/src/Resources.Designer.cs @@ -275,5 +275,15 @@ internal static string Workspace_loaded_in_0_ms { return ResourceManager.GetString("Workspace_loaded_in_0_ms", resourceCulture); } } + + /// + /// Looks up a localized string similar to The files to operate on. If none specified, all files in workspace will be operated on.. + /// + internal static string The_files_to_operate_on_If_none_specified_all_files_in_workspace_will_be_operated_on { + get { + return ResourceManager.GetString("The_files_to_operate_on_If_none_specified_all_files_in_workspace_will_be_operated" + + "_on", resourceCulture); + } + } } } diff --git a/src/Resources.resx b/src/Resources.resx index 040391a4a2..ab3587660d 100644 --- a/src/Resources.resx +++ b/src/Resources.resx @@ -186,4 +186,7 @@ Terminate with non-zero exit code if any files need to be formatted in the workspace. + + The files to operate on. If none specified, all files in workspace will be operated on. + \ No newline at end of file diff --git a/src/xlf/Resources.cs.xlf b/src/xlf/Resources.cs.xlf index 9d4310a860..7fa21de30b 100644 --- a/src/xlf/Resources.cs.xlf +++ b/src/xlf/Resources.cs.xlf @@ -117,6 +117,11 @@ Pracovní prostor se načetl za {0} ms. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.de.xlf b/src/xlf/Resources.de.xlf index 9023839c6e..f9923c59b3 100644 --- a/src/xlf/Resources.de.xlf +++ b/src/xlf/Resources.de.xlf @@ -117,6 +117,11 @@ Arbeitsbereich in {0} ms geladen. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.es.xlf b/src/xlf/Resources.es.xlf index d73a86eca4..a2aa4421a4 100644 --- a/src/xlf/Resources.es.xlf +++ b/src/xlf/Resources.es.xlf @@ -117,6 +117,11 @@ Espacio de trabajo cargado en {0} ms. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.fr.xlf b/src/xlf/Resources.fr.xlf index 19acbb5f16..9878e17fc2 100644 --- a/src/xlf/Resources.fr.xlf +++ b/src/xlf/Resources.fr.xlf @@ -117,6 +117,11 @@ Espace de travail chargé en {0} ms. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.it.xlf b/src/xlf/Resources.it.xlf index 3f3d41cb00..e71378f5d1 100644 --- a/src/xlf/Resources.it.xlf +++ b/src/xlf/Resources.it.xlf @@ -117,6 +117,11 @@ Area di lavoro caricata in {0} ms. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.ja.xlf b/src/xlf/Resources.ja.xlf index 3890ec94ca..3772565f75 100644 --- a/src/xlf/Resources.ja.xlf +++ b/src/xlf/Resources.ja.xlf @@ -117,6 +117,11 @@ ワークスペース {0} ミリ秒で読み込まれます。 + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.ko.xlf b/src/xlf/Resources.ko.xlf index 1f84fc50ee..57d0f2f106 100644 --- a/src/xlf/Resources.ko.xlf +++ b/src/xlf/Resources.ko.xlf @@ -117,6 +117,11 @@ 작업 영역이 {0}밀리초 안에 로드되었습니다. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.pl.xlf b/src/xlf/Resources.pl.xlf index 620d01247c..247f8455a5 100644 --- a/src/xlf/Resources.pl.xlf +++ b/src/xlf/Resources.pl.xlf @@ -117,6 +117,11 @@ Obszar roboczy załadowano w {0} ms. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.pt-BR.xlf b/src/xlf/Resources.pt-BR.xlf index 9078908287..9d88bdf1c8 100644 --- a/src/xlf/Resources.pt-BR.xlf +++ b/src/xlf/Resources.pt-BR.xlf @@ -117,6 +117,11 @@ Espaço de trabalho carregado em {0}ms. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.ru.xlf b/src/xlf/Resources.ru.xlf index 6a72556f57..1f3d77537e 100644 --- a/src/xlf/Resources.ru.xlf +++ b/src/xlf/Resources.ru.xlf @@ -117,6 +117,11 @@ Рабочая область загружена за {0} мс. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.tr.xlf b/src/xlf/Resources.tr.xlf index f095d9212d..d274419d07 100644 --- a/src/xlf/Resources.tr.xlf +++ b/src/xlf/Resources.tr.xlf @@ -117,6 +117,11 @@ Çalışma alanı {0} ms yüklü. + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.zh-Hans.xlf b/src/xlf/Resources.zh-Hans.xlf index 98a7757653..d20aacc108 100644 --- a/src/xlf/Resources.zh-Hans.xlf +++ b/src/xlf/Resources.zh-Hans.xlf @@ -117,6 +117,11 @@ 工作区已在 {0} 毫秒内加载完毕。 + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/src/xlf/Resources.zh-Hant.xlf b/src/xlf/Resources.zh-Hant.xlf index b3c3ae048b..d5791b1936 100644 --- a/src/xlf/Resources.zh-Hant.xlf +++ b/src/xlf/Resources.zh-Hant.xlf @@ -117,6 +117,11 @@ {0} 毫秒內載入的工作區。 + + The files to operate on. If none specified, all files in workspace will be operated on. + The files to operate on. If none specified, all files in workspace will be operated on. + + \ No newline at end of file diff --git a/tests/CodeFormatterTests.cs b/tests/CodeFormatterTests.cs index 1b65314ffe..b6b45477cb 100644 --- a/tests/CodeFormatterTests.cs +++ b/tests/CodeFormatterTests.cs @@ -22,7 +22,7 @@ public async Task NoFilesFormattedInFormattedProject() var logger = new TestLogger(); var path = Path.GetFullPath("tests/projects/for_code_formatter/formatted_project/formatted_project.csproj", SolutionPath); - var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, cancellationToken: CancellationToken.None); + var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, filesToFormat: null, cancellationToken: CancellationToken.None); var log = logger.GetLog(); var pattern = string.Format(Resources.Formatted_0_of_1_files_in_2_ms, "(\\d+)", "\\d+", "\\d+"); var filesFormatted = new Regex(pattern, RegexOptions.Multiline); @@ -42,8 +42,8 @@ public async Task NoFilesFormattedInFormattedSolution() var logger = new TestLogger(); var path = Path.GetFullPath("tests/projects/for_code_formatter/formatted_solution/formatted_solution.sln", SolutionPath); - var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: true, logAllWorkspaceWarnings: false, saveFormattedFiles: false, cancellationToken: CancellationToken.None); - var log = logger.GetLog(); + var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: true, logAllWorkspaceWarnings: false, saveFormattedFiles: false, filesToFormat: null, cancellationToken: CancellationToken.None); + var log = logger.GetLog(); var pattern = string.Format(Resources.Formatted_0_of_1_files_in_2_ms, "(\\d+)", "\\d+", "\\d+"); var filesFormatted = new Regex(pattern, RegexOptions.Multiline); var match = filesFormatted.Match(log); @@ -62,18 +62,18 @@ public async Task FilesFormattedInUnformattedProject() var logger = new TestLogger(); var path = Path.GetFullPath("tests/projects/for_code_formatter/unformatted_project/unformatted_project.csproj", SolutionPath); - var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, cancellationToken: CancellationToken.None); - var log = logger.GetLog(); + var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, filesToFormat: null, cancellationToken: CancellationToken.None); + var log = logger.GetLog(); var pattern = string.Format(Resources.Formatted_0_of_1_files_in_2_ms, "(\\d+)", "\\d+", "\\d+"); var filesFormatted = new Regex(pattern, RegexOptions.Multiline); var match = filesFormatted.Match(log); Assert.True(match.Success, log); - Assert.Equal("1", match.Groups[1].Value); + Assert.Equal("2", match.Groups[1].Value); Assert.Equal(0, formatResult.ExitCode); - Assert.Equal(1, formatResult.FilesFormatted); - Assert.Equal(3, formatResult.FileCount); + Assert.Equal(2, formatResult.FilesFormatted); + Assert.Equal(4, formatResult.FileCount); } [Fact] @@ -82,18 +82,18 @@ public async Task FilesFormattedInUnformattedSolution() var logger = new TestLogger(); var path = Path.GetFullPath("tests/projects/for_code_formatter/unformatted_solution/unformatted_solution.sln", SolutionPath); - var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: true, logAllWorkspaceWarnings: false, saveFormattedFiles: false, cancellationToken: CancellationToken.None); - var log = logger.GetLog(); + var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: true, logAllWorkspaceWarnings: false, saveFormattedFiles: false, filesToFormat: null, cancellationToken: CancellationToken.None); + var log = logger.GetLog(); var pattern = string.Format(Resources.Formatted_0_of_1_files_in_2_ms, "(\\d+)", "\\d+", "\\d+"); var filesFormatted = new Regex(pattern, RegexOptions.Multiline); var match = filesFormatted.Match(log); Assert.Equal(0, formatResult.ExitCode); - Assert.Equal(1, formatResult.FilesFormatted); - Assert.Equal(3, formatResult.FileCount); + Assert.Equal(2, formatResult.FilesFormatted); + Assert.Equal(4, formatResult.FileCount); Assert.True(match.Success, log); - Assert.Equal("1", match.Groups[1].Value); + Assert.Equal("2", match.Groups[1].Value); } [Fact] @@ -102,7 +102,7 @@ public async Task FSharpProjectsDoNotCreateException() var logger = new TestLogger(); var path = Path.GetFullPath("tests/projects/for_code_formatter/fsharp_project/fsharp_project.fsproj", SolutionPath); - var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, cancellationToken: CancellationToken.None); + var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, filesToFormat: null, cancellationToken: CancellationToken.None); var logLines = logger.GetLog().Split(Environment.NewLine); Assert.Equal(4, logLines.Length); @@ -114,5 +114,47 @@ public async Task FSharpProjectsDoNotCreateException() Assert.Equal(0, formatResult.FilesFormatted); Assert.Equal(0, formatResult.FileCount); } + + [Fact] + public async Task OnlyFormatFilesFromList() + { + var logger = new TestLogger(); + var path = Path.GetFullPath("tests/projects/for_code_formatter/unformatted_project/unformatted_project.csproj", SolutionPath); + + var files = new[] {"OtherClass.cs"}; + var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, filesToFormat: files, cancellationToken: CancellationToken.None); + var log = logger.GetLog(); + var pattern = string.Format(Resources.Formatted_0_of_1_files_in_2_ms, "(\\d+)", "\\d+", "\\d+"); + var filesFormatted = new Regex(pattern, RegexOptions.Multiline); + var match = filesFormatted.Match(log); + + Assert.True(match.Success, log); + Assert.Equal("1", match.Groups[1].Value); + + Assert.Equal(0, formatResult.ExitCode); + Assert.Equal(1, formatResult.FilesFormatted); + Assert.Equal(4, formatResult.FileCount); + } + + [Fact] + public async Task NoFilesFormattedWhenNotInList() + { + var logger = new TestLogger(); + var path = Path.GetFullPath("tests/projects/for_code_formatter/unformatted_project/unformatted_project.csproj", SolutionPath); + + var files = new[] {"ThisFileDoesNotExist.cs"}; + var formatResult = await CodeFormatter.FormatWorkspaceAsync(logger, path, isSolution: false, logAllWorkspaceWarnings: false, saveFormattedFiles: false, filesToFormat: files, cancellationToken: CancellationToken.None); + var log = logger.GetLog(); + var pattern = string.Format(Resources.Formatted_0_of_1_files_in_2_ms, "(\\d+)", "\\d+", "\\d+"); + var filesFormatted = new Regex(pattern, RegexOptions.Multiline); + var match = filesFormatted.Match(log); + + Assert.True(match.Success, log); + Assert.Equal("0", match.Groups[1].Value); + + Assert.Equal(0, formatResult.ExitCode); + Assert.Equal(0, formatResult.FilesFormatted); + Assert.Equal(4, formatResult.FileCount); + } } } diff --git a/tests/ProgramTests.cs b/tests/ProgramTests.cs index 1e21939658..9cbdd5870f 100644 --- a/tests/ProgramTests.cs +++ b/tests/ProgramTests.cs @@ -1,4 +1,5 @@ -using Xunit; +using System.IO; +using Xunit; namespace Microsoft.CodeAnalysis.Tools.Tests { @@ -40,5 +41,17 @@ public void ExitCodeIsSameWithoutCheck() Assert.Equal(formatResult.ExitCode, exitCode); } + + [Fact] + public void FilesFormattedDirectorySeparatorInsensitive() + { + var filePath = $"other_items{Path.DirectorySeparatorChar}OtherClass.cs"; + var files = Program.GetFileList(filePath); + + var filePathAlt = $"other_items{Path.AltDirectorySeparatorChar}OtherClass.cs"; + var filesAlt = Program.GetFileList(filePathAlt); + + Assert.True(files[0] == filesAlt[0]); + } } } diff --git a/tests/projects/for_code_formatter/unformatted_project/other_items/OtherClass.cs b/tests/projects/for_code_formatter/unformatted_project/other_items/OtherClass.cs new file mode 100644 index 0000000000..e4cfa76c00 --- /dev/null +++ b/tests/projects/for_code_formatter/unformatted_project/other_items/OtherClass.cs @@ -0,0 +1,12 @@ +using System; + +namespace for_code_formatter +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +}