Skip to content

fix(tooling): keep license headers idempotent on CRLF - #1175

Open
Gujiassh wants to merge 2 commits into
bytedance:mainfrom
Gujiassh:fix/license-header-crlf-idempotence
Open

fix(tooling): keep license headers idempotent on CRLF#1175
Gujiassh wants to merge 2 commits into
bytedance:mainfrom
Gujiassh:fix/license-header-crlf-idempotence

Conversation

@Gujiassh

Copy link
Copy Markdown
Contributor

Summary

  • recognize canonical license headers with either LF or CRLF line endings
  • leave already licensed files byte-identical instead of prepending a duplicate header
  • preserve the existing shebang exemptions and missing-header behavior
  • add hermetic Node tests that run only against temporary copied repositories

Fixes #1171

Testing

  • corepack pnpm@10.6.5 test on Node 18.20.8 and Node 22 (3/3)
  • independent 13-fixture, two-run base/head differential smoke
  • node --check for the implementation and tests
  • normal repository commit hooks, including the license writer and Rush check
  • targeted formatting and git diff --check

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.

[Bug] Pre-commit license task duplicates headers in CRLF checkouts

1 participant