Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,14 @@ public Task<ValidationResult> ValidateOptionArgumentsAsync(CommandLineOption com
}

public Task<ValidationResult> ValidateCommandLineOptionsAsync(ICommandLineOptions commandLineOptions)
=> ValidationResult.ValidTask;
{
if (!commandLineOptions.IsOptionSet(AzureDevOpsCommandLineOptions.AzureDevOpsOptionName) &&
commandLineOptions.IsOptionSet(AzureDevOpsCommandLineOptions.AzureDevOpsReportSeverity))
{
// If report-azdo is not set, but report-azdo-severity is set, it's invalid.
return ValidationResult.InvalidTask(AzureDevOpsResources.AzureDevOpsReportSeverityRequiresAzureDevOps);
}

return ValidationResult.ValidTask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ private async Task WriteExceptionAsync(string? explanation, Exception? exception
}

string stackTrace = exception.StackTrace;
int index = stackTrace.IndexOfAny(NewlineCharacters);
string firstLine = index == -1 ? stackTrace : stackTrace.Substring(0, index);

(string Code, string File, int LineNumber)? location = GetStackFrameLocation(firstLine);
string[] lines = stackTrace.Split(NewlineCharacters, StringSplitOptions.RemoveEmptyEntries);
(string Code, string File, int LineNumber)? location = lines.Select(GetStackFrameLocation).FirstOrDefault(location => location is not null);
if (location != null)
{
string root = RootFinder.Find();
Expand All @@ -145,19 +143,21 @@ private async Task WriteExceptionAsync(string? explanation, Exception? exception
return null;
}

bool weHaveFilePathAndCodeLine = !RoslynString.IsNullOrWhiteSpace(match.Groups["code"].Value);
string code = match.Groups["code"].Value;
bool weHaveFilePathAndCodeLine = !RoslynString.IsNullOrWhiteSpace(code);
if (!weHaveFilePathAndCodeLine)
{
return null;
}

if (RoslynString.IsNullOrWhiteSpace(match.Groups["file"].Value))
string file = match.Groups["file"].Value;
if (RoslynString.IsNullOrWhiteSpace(file) || !File.Exists(file))
{
return null;
}

int line = int.TryParse(match.Groups["line"].Value, out int value) ? value : 0;

return (match.Groups["code"].Value, match.Groups["file"].Value, line);
return (code, file, line);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AzureDevOpsReportSeverityRequiresAzureDevOps" xml:space="preserve">
<value>'--report-azdo-severity' requires '--report-azdo' to be enabled</value>
</data>
<data name="Description" xml:space="preserve">
<value>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Generátor sestav Azure DevOps pro zápis chyb do výstupu způsobem, který je pro AzureDev Ops srozumitelný.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Azure DevOps-Berichts-Generator, um Fehler auf eine Weise in die Ausgabe zu schreiben, die AzureDev Ops versteht.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">El generador de informes de Azure DevOps escribe errores en la salida de una manera que AzureDev Ops comprende.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Générateur de rapports Azure DevOps pour écrire les erreurs dans la sortie d’une manière comprise par Azure DevOps.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Il generatore di report di Azure DevOps per scrivere gli errori nell'output in un modo che Azure DevOps comprenda.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">AzureDev Ops が理解する方法で出力にエラーを書き込む Azure DevOps レポート生成プログラム。</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Azure DevOps가 이해할 수 있는 방식으로 출력에 오류를 기록하는 Azure DevOps 보고서 생성기입니다.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Generator raportów usługi Azure DevOps umożliwiający zapisywanie błędów w danych wyjściowych w sposób zrozumiały dla usługi Azure DevOps.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Gerador de relatórios do Azure DevOps para gravar erros na saída de uma forma que o Azure DevOps entenda.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Генератор отчетов Azure DevOps для записи ошибок в выходные данные в формате, который понимает Azure DevOps.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="tr" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Hataları Azure DevOps'un anlayacağı şekilde çıktıya yazan Azure DevOps rapor oluşturucusu.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Azure DevOps报表生成器,可通过 Azure DevOps 可理解的方式将错误写入输出。</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../AzureDevOpsResources.resx">
<body>
<trans-unit id="AzureDevOpsReportSeverityRequiresAzureDevOps">
<source>'--report-azdo-severity' requires '--report-azdo' to be enabled</source>
<target state="new">'--report-azdo-severity' requires '--report-azdo' to be enabled</target>
<note />
</trans-unit>
<trans-unit id="Description">
<source>Azure DevOps report generator to write errors to the output in a way that AzureDev Ops understands.</source>
<target state="translated">Azure DevOps 報告產生器以 Azure DevOps 可理解的方式將錯誤寫入輸出。</target>
Expand Down