зеркало из https://github.com/Azure/autorest.git
Fix conflicting suppressions (#4725)
This commit is contained in:
Родитель
f1e3be9399
Коммит
a5d2727e15
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@autorest/common",
|
||||
"comment": "Fix: Suppression of the same code for different area could conflict each other",
|
||||
"type": "patch"
|
||||
}
|
||||
],
|
||||
"packageName": "@autorest/common"
|
||||
}
|
|
@ -5,6 +5,7 @@ dictionaries:
|
|||
- node
|
||||
- typescript
|
||||
words:
|
||||
- arrayify
|
||||
- autorest
|
||||
- codemodel
|
||||
- yada
|
||||
|
|
|
@ -53,14 +53,14 @@ stages:
|
|||
|
||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||
- template: ./templates/create-tryit-comment.yaml
|
||||
- job: lintdocs
|
||||
displayName: Lint docs
|
||||
continueOnError: true
|
||||
steps:
|
||||
- script: |
|
||||
sudo npm install -g markdown-link-check
|
||||
find docs -name "*.md" -print0 | xargs -0 -n1 markdown-link-check -c ./markdown-link-check-config.json
|
||||
displayName: Find
|
||||
# - job: lintdocs
|
||||
# displayName: Lint docs
|
||||
# continueOnError: true
|
||||
# steps:
|
||||
# - script: |
|
||||
# sudo npm install -g markdown-link-check
|
||||
# find docs -name "*.md" -print0 | xargs -0 -n1 markdown-link-check -c ./markdown-link-check-config.json
|
||||
# displayName: Find
|
||||
|
||||
- stage: regressiontests
|
||||
displayName: Regression Tests
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
"ignorePatterns": [
|
||||
{
|
||||
"pattern": "^https://msdn.microsoft.com/en-us/library/azure/dn790568.aspx"
|
||||
},
|
||||
{
|
||||
"pattern": "^https://aka.ms/azsdk/dpcodegen"
|
||||
},
|
||||
{
|
||||
"pattern": "^https://dev.azure.com/azure-sdk/internal"
|
||||
}
|
||||
],
|
||||
"replacementPatterns": [
|
||||
|
|
|
@ -39,17 +39,17 @@ export class FilterLogger implements LoggerProcessor {
|
|||
private filterSuppressions(log: LogInfo): LogInfo | undefined {
|
||||
const hadSource = log.source && log.source.length > 0;
|
||||
let currentLog = log;
|
||||
const key = log.code?.toLowerCase();
|
||||
|
||||
// filter
|
||||
for (const sup of this.suppressions) {
|
||||
// matches key
|
||||
const key = log.code?.toLowerCase();
|
||||
|
||||
if (key && (key === sup.code || key.startsWith(`${sup.code}/`))) {
|
||||
// filter applicable sources
|
||||
if (log.source && hadSource) {
|
||||
currentLog = {
|
||||
...currentLog,
|
||||
source: log.source.filter(
|
||||
source: currentLog.source?.filter(
|
||||
(s) => !this.matchesSourceFilter(s.document, (s.position as PathPosition).path, sup),
|
||||
),
|
||||
};
|
||||
|
@ -58,7 +58,6 @@ export class FilterLogger implements LoggerProcessor {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// drop message if all source locations have been stripped
|
||||
if (hadSource && currentLog.source?.length === 0) {
|
||||
return undefined;
|
||||
|
|
Загрузка…
Ссылка в новой задаче