Bladeren bron

Add proc-macro test (#101)

Fernando Otero 8 maanden geleden
bovenliggende
commit
24d9fd37e9
1 gewijzigde bestanden met toevoegingen van 11 en 2 verwijderingen
  1. 11 2
      scripts/semver.mts

+ 11 - 2
scripts/semver.mts

@@ -1,8 +1,17 @@
 #!/usr/bin/env zx
 import 'zx/globals';
-import { cliArguments, workingDirectory } from './setup/shared.mts';
+import { cliArguments, getCargo, workingDirectory } from './setup/shared.mts';
 
 const [folder, ...args] = cliArguments();
 const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
 
-await $`cargo semver-checks --manifest-path ${manifestPath} ${args}`;
+const isProcMacro = getCargo(folder).lib['proc-macro'] === true;
+
+if (isProcMacro) {
+  echo(
+    chalk.yellow.bold('[ SKIPPED ]'),
+    'Proc-macro found: only library targets with API surface that can be checked for semver.'
+  );
+} else {
+  await $`cargo semver-checks --manifest-path ${manifestPath} ${args}`;
+}