in eng/tools/typespec-validation/src/rules/flavor-azure.ts [11:44]
async execute(host: TsvHost, folder: string): Promise<RuleResult> {
let success = true;
let stdOutput = "";
let errorOutput = "";
const configText = await host.readTspConfig(folder);
const config = yamlParse(configText);
const options = config?.options;
for (const emitter in options) {
if (this.isClientEmitter(emitter)) {
const flavor = options[emitter]?.flavor;
stdOutput += `"${emitter}":\n`;
stdOutput += ` flavor: ${flavor}\n`;
if (flavor !== "azure") {
success = false;
errorOutput +=
"tspconfig.yaml must define the following property:\n" +
"\n" +
"options:\n" +
` "${emitter}":\n` +
" flavor: azure\n\n";
}
}
}
return {
success: success,
stdOutput: stdOutput,
errorOutput: errorOutput,
};
}