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
@@ -1,3 +1,3 @@
import { join } from "path";
import { Suppression } from "suppressions";
import { parse as yamlParse } from "yaml";
Expand Down Expand Up @@ -387,15 +387,6 @@
}
}

export class TspConfigGoMgmtFixConstStutteringTrueSubRule extends TspconfigEmitterOptionsSubRuleBase {
constructor() {
super("@azure-tools/typespec-go", "fix-const-stuttering", true);
}
protected skip(_: any, folder: string) {
return skipForDataPlane(folder);
}
}

export class TspConfigGoMgmtGenerateSamplesTrueSubRule extends TspconfigEmitterOptionsSubRuleBase {
constructor() {
super("@azure-tools/typespec-go", "generate-samples", true);
Expand All @@ -414,13 +405,17 @@
}
}

// ----- Go az sub rules -----
export class TspConfigGoAzGenerateFakesTrueSubRule extends TspconfigEmitterOptionsSubRuleBase {
export class TspConfigGoMgmtGenerateFakesTrueSubRule extends TspconfigEmitterOptionsSubRuleBase {
constructor() {
super("@azure-tools/typespec-go", "generate-fakes", true);
}
protected skip(_: any, folder: string) {
return skipForDataPlane(folder);
}
}

// ----- Go az sub rules -----

export class TspConfigGoAzInjectSpansTrueSubRule extends TspconfigEmitterOptionsSubRuleBase {
constructor() {
super("@azure-tools/typespec-go", "inject-spans", true);
Expand Down Expand Up @@ -539,9 +534,8 @@
new TspConfigGoMgmtServiceDirMatchPatternSubRule(),
new TspConfigGoMgmtPackageDirectorySubRule(),
new TspConfigGoMgmtModuleEqualStringSubRule(),
new TspConfigGoMgmtFixConstStutteringTrueSubRule(),
new TspConfigGoMgmtGenerateSamplesTrueSubRule(),
new TspConfigGoAzGenerateFakesTrueSubRule(),
new TspConfigGoMgmtGenerateFakesTrueSubRule(),
new TspConfigGoMgmtHeadAsBooleanTrueSubRule(),
new TspConfigGoAzInjectSpansTrueSubRule(),
new TspConfigGoDpServiceDirMatchPatternSubRule(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { afterEach, beforeEach, describe, it, MockInstance, vi } from "vitest";

import { contosoTspConfig } from "@azure-tools/specs-shared/test/examples";
Expand All @@ -11,12 +11,11 @@
TspConfigCsharpAzNamespaceEqualStringSubRule,
TspConfigCsharpAzPackageDirectorySubRule,
TspConfigCsharpMgmtPackageDirectorySubRule,
TspConfigGoAzGenerateFakesTrueSubRule,
TspConfigGoAzInjectSpansTrueSubRule,
TspConfigGoDpModuleMatchPatternSubRule,
TspConfigGoDpPackageDirectoryMatchPatternSubRule,
TspConfigGoDpServiceDirMatchPatternSubRule,
TspConfigGoMgmtFixConstStutteringTrueSubRule,
TspConfigGoMgmtGenerateFakesTrueSubRule,
TspConfigGoMgmtGenerateSamplesTrueSubRule,
TspConfigGoMgmtHeadAsBooleanTrueSubRule,
TspConfigGoMgmtModuleEqualStringSubRule,
Expand Down Expand Up @@ -287,15 +286,6 @@
[new TspConfigGoMgmtModuleEqualStringSubRule()],
);

const goManagementFixConstStutteringTestCases = createEmitterOptionTestCases(
"@azure-tools/typespec-go",
managementTspconfigFolder,
"fix-const-stuttering",
true,
false,
[new TspConfigGoMgmtFixConstStutteringTrueSubRule()],
);

const goManagementGenerateExamplesTestCases = createEmitterOptionTestCases(
"@azure-tools/typespec-go",
managementTspconfigFolder,
Expand All @@ -311,16 +301,7 @@
"generate-fakes",
true,
false,
[new TspConfigGoAzGenerateFakesTrueSubRule()],
);

const goDpGenerateFakesTestCases = createEmitterOptionTestCases(
"@azure-tools/typespec-go",
"",
"generate-fakes",
true,
false,
[new TspConfigGoAzGenerateFakesTrueSubRule()],
[new TspConfigGoMgmtGenerateFakesTrueSubRule()],
);

const goManagementHeadAsBooleanTestCases = createEmitterOptionTestCases(
Expand Down Expand Up @@ -619,7 +600,6 @@
subRules: [
new TspConfigGoMgmtPackageDirectorySubRule(),
new TspConfigGoMgmtModuleEqualStringSubRule(),
new TspConfigGoMgmtFixConstStutteringTrueSubRule(),
],
tspconfigContent: `
options:
Expand Down Expand Up @@ -661,12 +641,10 @@
...goManagementServiceDirTestCases,
...goManagementPackageDirTestCases,
...goManagementModuleTestCases,
...goManagementFixConstStutteringTestCases,
...goManagementGenerateExamplesTestCases,
...goManagementGenerateFakesTestCases,
...goManagementHeadAsBooleanTestCases,
...goManagementInjectSpansTestCases,
...goDpGenerateFakesTestCases,
...goDpInjectSpansTestCases,
...goDpModuleTestCases,
...goDpPackageDirTestCases,
Expand Down
Loading