Skip to content

fix(semver-lock): normalize source line endings - #425

Open
worlldz wants to merge 1 commit into
base:mainfrom
worlldz:fix/semver-lock-line-endings
Open

fix(semver-lock): normalize source line endings#425
worlldz wants to merge 1 commit into
base:mainfrom
worlldz:fix/semver-lock-line-endings

Conversation

@worlldz

@worlldz worlldz commented Aug 28, 2026

Copy link
Copy Markdown

Summary

  • normalize CRLF source files to LF before computing semver-lock source hashes
  • preserve the existing behavior of ignoring exactly one trailing newline
  • cover both the normalization boundary and the full artifact-to-source-hash path

Why

generate-semver-lock hashes Solidity source bytes from the working tree. With no repository EOL policy, a Windows checkout using core.autocrlf=true has i/lf w/crlf Solidity files. The same commit therefore produces different sourceCodeHash values locally and in Linux CI, causing a false semver-lock diff.

Normalizing only CRLF pairs makes the hash independent of checkout configuration without changing hashes produced from the repository's LF sources.

Validation

  • go test ./scripts/autogen/generate-semver-lock
  • go test ./scripts/autogen/... ./scripts/checks/common
  • git diff --check

@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/2
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

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.

2 participants