Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

ci: include crate chain check in scripts path filter

Steven Enamakel58dcdaec1d72
diff --git a/.github/ci-paths-filter.yml b/.github/ci-paths-filter.yml
index 57b8a189ee..9414f66a65 100644
--- a/.github/ci-paths-filter.yml
+++ b/.github/ci-paths-filter.yml
@@ -146,6 +146,7 @@ scripts:
- 'scripts/ci/check-module-boundaries.mjs'
- 'scripts/ci/module-boundaries.json'
- 'scripts/ci/check-process-statics.mjs'
+ - 'scripts/ci/check-crate-chain.mjs'
- 'scripts/ci/process-statics.json'
- 'scripts/mock-api/**'
- 'scripts/*.mjs'
diff --git a/scripts/ci/check-crate-chain.mjs b/scripts/ci/check-crate-chain.mjs
index fb604a9733..af2c3616d0 100644
--- a/scripts/ci/check-crate-chain.mjs
+++ b/scripts/ci/check-crate-chain.mjs
@@ -136,8 +136,9 @@ export function stripRustComments(text, { preserveLiterals = false, compact = fa
let i = 0;
let pendingBoundary = false;
const word = char => /[\p{ID_Continue}]/u.test(char);
- const joins = new Set(['::', '->', '=>', '==', '!=', '<=', '>=', '&&', '||',
- '<<', '>>', '+=', '-=', '*=', '/=', '%=', '&=', '|=', '^=', '..', '/*', '//']);
+ // Rust punctuation spacing can distinguish macro arms, including a third
+ // character completing an operator. Retain all separated punctuation pairs.
+ const punctuation = new Set("=<>!~+-*/%^&|@.,;:#$?'" );
const append = chunk => {
if (!chunk) return;
if (compact && preserveTokenBoundaries && pendingBoundary && out) {
@@ -150,7 +151,8 @@ export function stripRustComments(text, { preserveLiterals = false, compact = fa
(left === '#' && right === '"') ||
(left === '.' && /[0-9]/.test(right)) ||
(/[0-9]/.test(left) && right === '.') ||
- joins.has(left + right)) out += ' ';
+ (/[eE]/.test(left) && ['+', '-'].includes(right)) ||
+ (punctuation.has(left) && punctuation.has(right))) out += ' ';
}
out += chunk;
pendingBoundary = false;