Skip to content

Commit e145b10

Browse files
committed
fix(audits): fail comment-hygiene on unparsable files, raise listing buffer, correct ribbon arc note
1 parent f55150f commit e145b10

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎apps/sim/lib/pptx-renderer/shapes/presets.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6120,7 +6120,7 @@ multiPathPresets.set('horizontalscroll', (w, h, adjustments) => {
61206120
p1.push(arc.svg)
61216121
cx = arc.x
61226122
cy = arc.y
6123-
// arcTo from (w, ch2) with stAng=0 swAng=90° ends at (x4, 0); then lnTo (x4, ch2)
6123+
// The arc ends at (x4, ch): center (x4, ch2), swept 90° from stAng=0. lnTo back up to (x4, ch2).
61246124
p1.push(`L${x4},${ch2}`)
61256125
// arcTo wR=ch4 hR=ch4 stAng=0 swAng=cd2(180°)
61266126
arc = ooArcTo(x4, ch2, ch4, ch4, 0, 180)

‎scripts/check-comment-hygiene.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { readFileSync } from 'node:fs'
3030
import path from 'node:path'
3131
import { fileURLToPath } from 'node:url'
3232
import { parse } from '@babel/parser'
33+
import { getErrorMessage } from '@sim/utils/errors'
3334

3435
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
3536
const ALLOW = 'comment-hygiene-allow:'
@@ -163,8 +164,8 @@ export function findViolations(file: string, source: string): Violation[] {
163164
plugins: ['typescript', ...(jsx ? (['jsx'] as const) : []), 'decorators'],
164165
errorRecovery: true,
165166
}).comments ?? []
166-
} catch {
167-
return []
167+
} catch (error) {
168+
throw new Error(`Cannot parse ${file} to check its comments: ${getErrorMessage(error)}`)
168169
}
169170

170171
const lines = source.split('\n')
@@ -215,6 +216,8 @@ function sourceFiles(): string[] {
215216
return execFileSync('git', ['ls-files', '*.ts', '*.tsx', '*.mts', '*.cts', '*.mjs', '*.cjs'], {
216217
cwd: ROOT,
217218
encoding: 'utf8',
219+
// The listing is already ~1 MB, the default execFileSync ceiling.
220+
maxBuffer: 64 * 1024 * 1024,
218221
})
219222
.split('\n')
220223
.filter((file) => file && !EXCLUDED.some((pattern) => pattern.test(file)))

0 commit comments

Comments
 (0)