Skip to content

Commit 8e03bf4

Browse files
Add dryrun support for autorest (#2382)
1 parent f18f84a commit 8e03bf4

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: feature
3+
packages:
4+
- "@azure-tools/typespec-autorest"
5+
---
6+
7+
Add support for new `dryRun` option

packages/typespec-autorest/src/emit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ async function emitAllServiceAtAllVersions(
224224
options: ResolvedAutorestEmitterOptions,
225225
) {
226226
const services = await getAllServicesAtAllVersions(program, options);
227-
if (program.compilerOptions.noEmit || program.hasError()) {
227+
if (program.compilerOptions.dryRun || program.hasError()) {
228228
return;
229229
}
230230
for (const serviceRecord of services) {

packages/typespec-autorest/src/lib.ts

+3
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ const EmitterOptionsSchema: JSONSchemaType<AutorestEmitterOptions> = {
239239

240240
export const $lib = createTypeSpecLibrary({
241241
name: "@azure-tools/typespec-autorest",
242+
capabilities: {
243+
dryRun: true,
244+
},
242245
diagnostics: {
243246
"duplicate-body-types": {
244247
severity: "error",

0 commit comments

Comments
 (0)