Skip to content

Commit 889162f

Browse files
committed
fix(lint): migrate socket-hook markers to socket-lint prefix
The pre-commit/pre-push gates honor only the `socket-lint:` marker prefix; `socket-hook:` markers were silently non-functional, leaving the guarded lines unprotected. Swaps the prefix and corrects rule names to the recognized set.
1 parent b76db0c commit 889162f

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

packages/cli/src/cli-entry.mts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void (async () => {
219219
} catch {
220220
// Last-ditch fallback when logger itself throws — the catch
221221
// ensures we still report the original error before exit.
222-
logger.fail('Fatal error:', err) // # socket-hook: allow logger
222+
logger.fail('Fatal error:', err) // # socket-lint: allow logger
223223
}
224224

225225
// Track CLI error for fatal exceptions.
@@ -238,7 +238,7 @@ process.on('uncaughtException', async err => {
238238
logger.error('Uncaught exception:', err)
239239
} catch {
240240
// Last-ditch fallback when logger itself throws.
241-
logger.fail('Uncaught exception:', err) // # socket-hook: allow logger
241+
logger.fail('Uncaught exception:', err) // # socket-lint: allow logger
242242
}
243243

244244
// Track CLI error for uncaught exception.
@@ -252,7 +252,7 @@ process.on('uncaughtException', async err => {
252252
logger.error('Error in uncaughtException handler:', e)
253253
} catch {
254254
// Last-ditch fallback when logger itself throws.
255-
logger.fail('Error in uncaughtException handler:', e) // # socket-hook: allow logger
255+
logger.fail('Error in uncaughtException handler:', e) // # socket-lint: allow logger
256256
}
257257
} finally {
258258
process.exit(1)
@@ -266,7 +266,7 @@ process.on('unhandledRejection', async (reason, promise) => {
266266
logger.error('Unhandled rejection at:', promise, 'reason:', reason)
267267
} catch {
268268
// Last-ditch fallback when logger itself throws.
269-
logger.fail('Unhandled rejection at:', promise, 'reason:', reason) // # socket-hook: allow logger
269+
logger.fail('Unhandled rejection at:', promise, 'reason:', reason) // # socket-lint: allow logger
270270
}
271271

272272
// Track CLI error for unhandled rejection.
@@ -281,7 +281,7 @@ process.on('unhandledRejection', async (reason, promise) => {
281281
logger.error('Error in unhandledRejection handler:', e)
282282
} catch {
283283
// Last-ditch fallback when logger itself throws.
284-
logger.fail('Error in unhandledRejection handler:', e) // # socket-hook: allow logger
284+
logger.fail('Error in unhandledRejection handler:', e) // # socket-lint: allow logger
285285
}
286286
} finally {
287287
process.exit(1)

packages/cli/src/commands/npx/cmd-npx.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { defineHandoffCommand } from '../../util/cli/define-handoff.mts'
1010

1111
export const cmdNpx = defineHandoffCommand({
1212
name: NPX,
13-
description: 'Run pnpm exec with Socket Firewall security', // socket-hook: allow npx
13+
description: 'Run pnpm exec with Socket Firewall security', // socket-lint: allow npx
1414
spawnMode: 'auto',
1515
examples: ['cowsay', 'cowsay@1.6.0 hello'],
1616
showApiRequirements: true,

packages/cli/src/util/fs/glob.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export function ignorePatternToMinimatch(pattern: string): string {
274274
// Minimatch pattern `src/\{a,b}.js` is equivalent to gitignore pattern `src/{a,b}.js`.
275275
const escapedPatternWithoutLeadingSlash =
276276
patternWithoutLeadingSlash.replaceAll(
277-
/(?=((?:\\.|[^{(])*))\1([{(])/guy, // socket-hook: allow regex-alternation-order -- `\\.` must come first so escape pairs are consumed atomically.
277+
/(?=((?:\\.|[^{(])*))\1([{(])/guy, // socket-lint: allow regex-alternation-order -- `\\.` must come first so escape pairs are consumed atomically.
278278
'$1\\$2',
279279
)
280280
const matchInsideSuffix = patternToTest.endsWith('/**') ? '/*' : ''

packages/cli/test/unit/util/cli/with-subcommands.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ describe('meow-with-subcommands', () => {
831831
logout: stub('logout'),
832832
manifest: stub('manifest'),
833833
npm: stub('npm'),
834-
npx: stub('npx'), // socket-hook: allow npx
834+
npx: stub('npx'), // socket-lint: allow npx
835835
nuget: stub('nuget'),
836836
optimize: stub('optimize'),
837837
organization: stub('organization'),

0 commit comments

Comments
 (0)