From ed79a06ebae9a59fbf5c4f05a90db2ed85aeb013 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 26 Feb 2021 08:27:54 -0800 Subject: [PATCH] Add warning when --diagnostics specified in wrong context --- src/FormatCommand.cs | 4 ++-- src/Program.cs | 5 +++++ src/Resources.resx | 9 +++++++++ src/xlf/Resources.cs.xlf | 15 +++++++++++++++ src/xlf/Resources.de.xlf | 15 +++++++++++++++ src/xlf/Resources.es.xlf | 15 +++++++++++++++ src/xlf/Resources.fr.xlf | 15 +++++++++++++++ src/xlf/Resources.it.xlf | 15 +++++++++++++++ src/xlf/Resources.ja.xlf | 15 +++++++++++++++ src/xlf/Resources.ko.xlf | 15 +++++++++++++++ src/xlf/Resources.pl.xlf | 15 +++++++++++++++ src/xlf/Resources.pt-BR.xlf | 15 +++++++++++++++ src/xlf/Resources.ru.xlf | 15 +++++++++++++++ src/xlf/Resources.tr.xlf | 15 +++++++++++++++ src/xlf/Resources.zh-Hans.xlf | 15 +++++++++++++++ src/xlf/Resources.zh-Hant.xlf | 15 +++++++++++++++ 16 files changed, 211 insertions(+), 2 deletions(-) diff --git a/src/FormatCommand.cs b/src/FormatCommand.cs index d37173252b..0de958fa97 100644 --- a/src/FormatCommand.cs +++ b/src/FormatCommand.cs @@ -89,7 +89,7 @@ internal static RootCommand CreateCommandLineOptions() var folder = symbolResult.ValueForOption("--folder"); var fixAnalyzers = symbolResult.OptionResult("--fix-analyzers"); return folder && fixAnalyzers != null - ? "Cannot specify the '--folder' option when running analyzers." + ? Resources.Cannot_specify_the_folder_option_when_running_analyzers : null; } @@ -98,7 +98,7 @@ internal static RootCommand CreateCommandLineOptions() var folder = symbolResult.ValueForOption("--folder"); var fixStyle = symbolResult.OptionResult("--fix-style"); return folder && fixStyle != null - ? "Cannot specify the '--folder' option when fixing style." + ? Resources.Cannot_specify_the_folder_option_when_fixing_style : null; } diff --git a/src/Program.cs b/src/Program.cs index c3bc353899..99a349306e 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -150,6 +150,11 @@ private static async Task Main(string[] args) fixType |= FixCategory.Analyzers; } + if (fixType == FixCategory.None && diagnostics.Length > 0) + { + logger.LogWarning(Resources.The_diagnostics_option_only_applies_when_fixing_style_or_running_analyzers); + } + if (fixType == FixCategory.None || fixWhitespace) { fixType |= FixCategory.Whitespace; diff --git a/src/Resources.resx b/src/Resources.resx index 13a22a5352..7039987d3b 100644 --- a/src/Resources.resx +++ b/src/Resources.resx @@ -300,4 +300,13 @@ A space separated list of diagnostic ids to use as a filter when fixing code style or 3rd party issues. + + The '--diagnostics' option only applies when fixing style or running analyzers. + + + Cannot specify the '--folder' option when running analyzers. + + + Cannot specify the '--folder' option when fixing style. + \ No newline at end of file diff --git a/src/xlf/Resources.cs.xlf b/src/xlf/Resources.cs.xlf index 99b221a665..cf11606b5d 100644 --- a/src/xlf/Resources.cs.xlf +++ b/src/xlf/Resources.cs.xlf @@ -42,6 +42,16 @@ {0} obsahuje jak soubor projektu MSBuild, tak soubor řešení. Určete, který soubor chcete použít, pomocí argumentu <workspace>. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Styl kódu @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. Verze .NET CLI je {0}. diff --git a/src/xlf/Resources.de.xlf b/src/xlf/Resources.de.xlf index 249c273e3c..8fc9c319c5 100644 --- a/src/xlf/Resources.de.xlf +++ b/src/xlf/Resources.de.xlf @@ -42,6 +42,16 @@ In "{0}" wurden eine MSBuild-Projektdatei und eine Projektmappendatei gefunden. Geben Sie die zu verwendende Datei mit dem <workspace>-Argument an. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Codeformat @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. Die dotnet-CLI-Version ist "{0}". diff --git a/src/xlf/Resources.es.xlf b/src/xlf/Resources.es.xlf index 8c347e62b3..bb11f12b9e 100644 --- a/src/xlf/Resources.es.xlf +++ b/src/xlf/Resources.es.xlf @@ -42,6 +42,16 @@ Se encontró un archivo del proyecto y un archivo de solución MSBuild en "{0}". Especifique cuál debe usarse con el argumento <workspace>. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Estilo de código @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. La versión de la CLI de dotnet es "{0}". diff --git a/src/xlf/Resources.fr.xlf b/src/xlf/Resources.fr.xlf index a82888360f..de2b7a6b5c 100644 --- a/src/xlf/Resources.fr.xlf +++ b/src/xlf/Resources.fr.xlf @@ -42,6 +42,16 @@ Fichier projet et fichier solution MSBuild trouvés dans '{0}'. Spécifiez celui qui doit être utilisé avec l'argument <espace de travail>. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Style de code @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. La version de l'interface CLI dotnet est '{0}'. diff --git a/src/xlf/Resources.it.xlf b/src/xlf/Resources.it.xlf index e42bb11d58..7f15b91ff9 100644 --- a/src/xlf/Resources.it.xlf +++ b/src/xlf/Resources.it.xlf @@ -42,6 +42,16 @@ In '{0}' sono stati trovati sia un file di progetto che un file di soluzione MSBuild. Per specificare quello desiderato, usare l'argomento <workspace>. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Stile codice @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. La versione dell'interfaccia della riga di comando di dotnet è '{0}'. diff --git a/src/xlf/Resources.ja.xlf b/src/xlf/Resources.ja.xlf index fbc29791b3..db9480d7cf 100644 --- a/src/xlf/Resources.ja.xlf +++ b/src/xlf/Resources.ja.xlf @@ -42,6 +42,16 @@ MSBuild のプロジェクト ファイルとソリューション ファイルの両方が '{0}' で見つかりました。使用するものを <workspace> 引数で指定してください。 + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style コード スタイル @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. dotnet CLI バージョンは '{0}' です。 diff --git a/src/xlf/Resources.ko.xlf b/src/xlf/Resources.ko.xlf index ed61b7cc3f..02ad457f85 100644 --- a/src/xlf/Resources.ko.xlf +++ b/src/xlf/Resources.ko.xlf @@ -42,6 +42,16 @@ '{0}'에 MSBuild 프로젝트 파일 및 솔루션 파일이 모두 있습니다. <workspace> 인수를 사용하여 사용할 파일을 지정하세요. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style 코드 스타일 @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. dotnet CLI 버전은 '{0}'입니다. diff --git a/src/xlf/Resources.pl.xlf b/src/xlf/Resources.pl.xlf index e075eca397..c5ec97c4bf 100644 --- a/src/xlf/Resources.pl.xlf +++ b/src/xlf/Resources.pl.xlf @@ -42,6 +42,16 @@ W elemencie „{0}” znaleziono zarówno plik rozwiązania, jak i plik projektu MSBuild. Określ plik do użycia za pomocą argumentu <workspace>. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Styl kodu @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. Wersja interfejsu wiersza polecenia dotnet to „{0}”. diff --git a/src/xlf/Resources.pt-BR.xlf b/src/xlf/Resources.pt-BR.xlf index fceabd1938..bf778f4b14 100644 --- a/src/xlf/Resources.pt-BR.xlf +++ b/src/xlf/Resources.pt-BR.xlf @@ -42,6 +42,16 @@ Foram encontrados um arquivo de solução e um arquivo de projeto do MSBuild em '{0}'. Especifique qual será usado com o argumento <workspace>. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Estilo do Código @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. A versão do CLI do dotnet é '{0}'. diff --git a/src/xlf/Resources.ru.xlf b/src/xlf/Resources.ru.xlf index 6ef10772c4..2d8461cca2 100644 --- a/src/xlf/Resources.ru.xlf +++ b/src/xlf/Resources.ru.xlf @@ -42,6 +42,16 @@ В "{0}" обнаружены как файл проекта, так и файл решения MSBuild. Укажите используемый файл с помощью аргумента <workspace>. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Стиль кода @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. Версия CLI dotnet: "{0}". diff --git a/src/xlf/Resources.tr.xlf b/src/xlf/Resources.tr.xlf index 80eab93590..d6a8eb19f3 100644 --- a/src/xlf/Resources.tr.xlf +++ b/src/xlf/Resources.tr.xlf @@ -42,6 +42,16 @@ '{0}' içinde hem MSBuild proje dosyası hem de çözüm dosyası bulundu. Hangisinin <çalışma alanı> bağımsız değişkeni ile kullanılacağını belirtin. + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style Kod Stili @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. dotnet CLI sürümü: '{0}'. diff --git a/src/xlf/Resources.zh-Hans.xlf b/src/xlf/Resources.zh-Hans.xlf index a1ca40ca9d..b36cb4220b 100644 --- a/src/xlf/Resources.zh-Hans.xlf +++ b/src/xlf/Resources.zh-Hans.xlf @@ -42,6 +42,16 @@ 在“{0}”中同时找到 MSBuild 项目文件和解决方案文件。请指定要用于 <workspace> 参数的文件。 + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style 代码样式 @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. dotnet CLI 版本为“{0}”。 diff --git a/src/xlf/Resources.zh-Hant.xlf b/src/xlf/Resources.zh-Hant.xlf index 55504ed495..31373bec38 100644 --- a/src/xlf/Resources.zh-Hant.xlf +++ b/src/xlf/Resources.zh-Hant.xlf @@ -42,6 +42,16 @@ 在 '{0}' 中同時找到 MSBuild 專案檔與解決方案檔。請指定要用於 <workspace> 引數的檔案。 + + Cannot specify the '--folder' option when fixing style. + Cannot specify the '--folder' option when fixing style. + + + + Cannot specify the '--folder' option when running analyzers. + Cannot specify the '--folder' option when running analyzers. + + Code Style 程式碼樣式 @@ -217,6 +227,11 @@ Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both. + + The '--diagnostics' option only applies when fixing style or running analyzers. + The '--diagnostics' option only applies when fixing style or running analyzers. + + The dotnet CLI version is '{0}'. dotnet CLI 版本為 '{0}'。