Linting Process Does Not Fix Certain Issues Automatically
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Lint Tests Passing Locally but Failing in CI/CD Pipeline
What it shows in the terminal- https://github.com/user-attachments/assets/8761f199-63c8-4e01-b70f-f8d2a77aad4d
What it shows in the CICD pipeline:
Product
kolibri-design-system
Expected behavior
The linter should fix the introduces changes automatically like removing extra spaces ,semicolons etc.
Actual behavior
The linter does not fix the changes automatically , and remains unaltered.
Steps to reproduce the issue
- Make a change that violates a linter rule. For example: 2)Run yarn lint-fix. 3)Check the output and verify whether the expected issues were fixed. 4)Run git status to see if any changes were made to the files.
Environment
Local Environment: Node.js version: 10.x Yarn version: 1.x Operating System: Windows
##Comments This issue has been observed by multiple contributors. Please let me know if additional details or examples are needed.
@MisRob I raised the issue , would you put some labels ,if it deserves.
Hi @RONAK-AI647, thank you! I wonder if this could be specific to Windows. I will keep observing with other contributors and perhaps we can see some similarities.
Related PR https://github.com/learningequality/kolibri-design-system/pull/827
For reference, @rtibbles noted some of the linting issues may be fixed as soon as we upgrade kolibri-tools
Please Assign it to me @MisRob
Thanks @RONAK-AI647 if you have some new insights, you're welcome to look into this - I noticed you resolved it on one of your PRs
The linting package has now been updated - checking to see if this recurs locally would be helpful. If it is still happening, I think it must be a Windows specific issue.
Hi @RONAK-AI647, I wanted to mention that Learning Equality will be closed from December 23 to January 5.
I cannot find you in the member's list of learning equality @MisRob ?? I see the contributor tag on ur comments.🧐
Sorry @RONAK-AI647, you should see me there now. It was just something with membership visibility settings.
Hello maintainers @rtibbles @MisRob , Upon this issue , as many new contributors face this issue of not able to run "yarn lint-fix" command , and the reason I found out was " the jobs of linting( yarn lint-fix is run on UBUNTU machine " which most of the users miss ( running it on the windows machine . If you all allow , the following are my thoughts which can be done or else we would close this issue.
- If certain contributors encounter environment-specific issues, you can test linting on multiple environments (e.g., Windows, macOS, and Ubuntu) by adding matrix builds. 2.Update the dev_docs\01_getting_started.md file , so could it help the new contributors .
- Adding a pre-commit hook to run linting automatically before commits. This reduces the chance of contributors missing it.
- Otherwise close this issue .
Thank You @AlexVelezLl for guidance .
The linting package has now been updated - checking to see if this recurs locally would be helpful. If it is still happening, I think it must be a Windows specific issue.
Yes @rtibbles , this is specific to windows latest.
I think adding a pre-commit hook would be the simplest thing here. In our other repositories we use the Python pre-commit package, but I am guessing we've not added it here because no other Python dependencies are involved.
So if we are not going ahead with Python pre-commit as KDS lack python dependencies , shall we think of node js based pre commit hook system.
Seems like husky is the main solution out there, seems like we could run the same linting command with that, and keep a purely JS ecosystem for KDS.
https://typicode.github.io/husky/how-to.html
Will happily receive a PR that runs yarn run lint-fix with appropriate arguments to ensure it lints only staged files.
I think the last requirement I put there will be best achieved by using husky in combination with this: https://github.com/lint-staged/lint-staged?tab=readme-ov-file#configuration
@rtibbles Take a look Please , I have raised a PR.
Hi @RONAK-AI647! Thank you!
We are currently closed for the year and may be slow to respond. Rest assured, we will give your pr a look once we are back fully next year.
Thanks Again!