-
Notifications
You must be signed in to change notification settings - Fork 0
Add pre-commit or CI step to enforce UTF-8 BOM encoding on source files #230
Copy link
Copy link
Open
Labels
Description
Context
PowerShell source files in a repository may have inconsistent file encodings. If files are not uniformly UTF-8 with BOM, it can cause issues with special characters, tests, or module loading.
Request
A pre-commit or CI step should ensure all relevant source files (.ps1, .psm1, .psd1, etc.) are encoded as UTF-8 with BOM before changes are pushed. This prevents encoding inconsistencies from being introduced into the repository.
What is expected
- All PowerShell source files are validated and/or converted to UTF-8 with BOM encoding
- The check runs automatically (pre-commit hook or CI step)
- Developers are informed when files with incorrect encoding are detected
Acceptance criteria
- An automated step validates file encoding before code enters the repository
- Files with incorrect encoding are either auto-converted or flagged for the developer
- The solution works cross-platform (Windows, macOS, Linux)
Technical decisions
To be determined during implementation planning — evaluate pre-commit hook vs. CI step vs. build-time conversion.
Implementation plan
- Decide on enforcement mechanism: pre-commit hook, CI check, or build step
- Implement encoding validation/conversion for
.ps1,.psm1,.psd1files - Integrate into the appropriate workflow stage
- Test with files containing special characters to verify correctness
Reactions are currently unavailable