Skip to content

Conversation

@jdalton
Copy link
Contributor

@jdalton jdalton commented Nov 5, 2025

Summary

Completes the logger hoisting refactoring started in #229cb0f00 by hoisting getDefaultLogger() calls in 10 additional command and utility files that were initially missed.

Changes

  • Modified 10 files with inline getDefaultLogger().method() calls
  • Replaced with module-scoped const logger = getDefaultLogger() pattern
  • Maintains consistency with the codebase-wide logger hoisting pattern

Files Modified

  • packages/cli/src/commands/analytics/cmd-analytics.mts
  • packages/cli/src/commands/ci/cmd-ci.mts
  • packages/cli/src/commands/config/cmd-config-unset.mts
  • packages/cli/src/commands/logout/cmd-logout.mts
  • packages/cli/src/commands/manifest/cmd-manifest-setup.mts
  • packages/cli/src/commands/manifest/run-cdxgen.mts
  • packages/cli/src/commands/npx/cmd-npx.mts
  • packages/cli/src/commands/package/fetch-purl-deep-score.mts
  • packages/cli/src/commands/scan/cmd-scan-github.mts
  • packages/cli/src/commands/scan/stream-scan.mts

Benefits

  • Single logger initialization per module
  • Better code clarity and consistency
  • Slight performance improvement (no repeated function calls)

Test plan

  • All security checks passed
  • Build verification: pnpm build
  • Type checks: pnpm run type
  • Lint checks: pnpm run lint

@jdalton jdalton force-pushed the refactor/hoist-remaining-logger-calls branch 2 times, most recently from 13276d6 to e813468 Compare November 5, 2025 15:39
…tion

- Hoist getDefaultLogger() calls to module scope in integration and check scripts
- Fix flaky getBaseBranch test by properly isolating environment variables
- Clear GITHUB_BASE_REF in test as it takes priority over GITHUB_REF_NAME
@jdalton jdalton force-pushed the refactor/hoist-remaining-logger-calls branch 2 times, most recently from 0efaab7 to a55c2a5 Compare November 5, 2025 15:57
@mikolalysenko mikolalysenko merged commit 49d54fd into main Nov 5, 2025
21 checks passed
@mikolalysenko mikolalysenko deleted the refactor/hoist-remaining-logger-calls branch November 5, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants