-
-
Notifications
You must be signed in to change notification settings - Fork 62
Standardize line endings and integrate frontend linters. Closes #729, Closes #727 #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Standardize line endings and integrate frontend linters. Closes #729, Closes #727 #730
Conversation
…-commit Fixes intelowlproject#729: Fix inconsistent line endings causing CI failures on Windows - Update Ruff config to enforce LF line endings (line-ending = 'lf') - Add .gitattributes to normalize line endings via Git Fixes intelowlproject#727: Integrate Frontend Linters into Pre-commit Workflow - Add Prettier hook using local npm script (npm run formatter) - Add ESLint hook using local npm script (npm run lint) - Uses same linter versions as CI to ensure consistency
Question for Maintainers: NPM Dependencies Requirement@mlodic @regulartim This means developers need to:
Before Options to consider:Option A: Document the requirement (current approach)
Option B: Skip frontend hooks if npm not installed
Option C: Use pre-commit mirrors (rejected)
|
|
I don't have a strong opinion on this but tend to option A. I would like to hear what @mlodic thinks about this. |
|
I wouldn't enforce the requirement because some people could never work on the frontend. I vote B |
Yeah, good point, I agree. |
|
I agree with Option B as well. A one-time CI linting failure is much more acceptable than having contributors inadvertently modify I'll update the hooks to gracefully skip if |
Frontend pre-commit hooks (prettier, eslint) now gracefully skip if frontend/node_modules doesn't exist. This allows backend-only contributors to use pre-commit without needing to run npm install in frontend/.
|
I've implemented Option B and the PR is ready for review. I've attached a screenshot showing the pre-commit hooks working correctly (including the skip behavior when However, I'm having difficulty figuring out how to properly test the line-ending changes locally:
Could you advise on the best way to verify these changes work correctly for Windows contributors? The main goal is to ensure CRLF line endings from Windows don't cause CI failures anymore. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR standardizes line endings to LF across all platforms and integrates frontend linters into the pre-commit workflow to catch formatting issues before CI.
Changes:
- Updated Ruff configuration to enforce LF line endings instead of platform-native endings
- Added comprehensive
.gitattributesfile to normalize all text files to LF on checkout and commit - Integrated Prettier and ESLint into pre-commit using local npm scripts with graceful fallback for backend-only contributors
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/configurations/python_linters/.ruff.toml |
Changed line-ending setting from "native" to "lf" to enforce consistent Unix-style line endings |
.github/.pre-commit-config.yaml |
Added Prettier and ESLint hooks using local npm scripts that match CI commands, with graceful degradation for contributors without node_modules |
.gitattributes |
Added comprehensive Git attributes configuration to normalize line endings for all text files and mark binary files appropriately |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Nice, thank you @opbot-xd ! I guess you could test by taking a python file from the code base, change the line endings to CRLF (most editors can do that) and try to commit it. Of course it would also be nice if a windows user would test it. @shivraj1182 , would you do that? |
Tested the Line Endings FixThanks for the suggestion @regulartim! I tested by converting a Python file to CRLF line endings: Test performed:
The |
|
@opbot-xd @regulartim, This looks good to me, thanks for handling the Windows line-ending issues and frontend linters! |


Description
This PR addresses two related issues to improve the developer experience and CI consistency:
Line Endings Standardization (Fix inconsistent line endings causing CI failures on Windows #729): Resolves CI failures that occur when Windows contributors submit PRs with CRLF line endings. The Ruff config now enforces
lfline endings, and a .gitattributes file ensures Git normalizes all text files to LF.Frontend Linters in Pre-commit (Integrate Frontend Linters into Pre-commit Workflow #727): Integrates Prettier and ESLint into the pre-commit workflow using local npm scripts, matching the exact same commands used in CI. This catches formatting and linting issues before commit rather than at CI time.
Related issues
Type of change
Checklist
develop.Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.