Automatic COMMITs and PRs checkers and PRE-COMMIT script for local development. #875
Replies: 4 comments 1 reply
-
Tanks to both of you! And lest "make code prettier again" ;-) |
Beta Was this translation helpful? Give feedback.
-
Hi @cavearr, I can do further confirmations on Windows. You have already tested Windows I think? => 1. Do But cmd can run manually:
and also with "/dev/null", same result - no error about path:
(silent) => 2. Earlier in "winico" you put back the Cheers let me know |
Beta Was this translation helpful? Give feedback.
-
Hi @TimRudy ! thanks for try and for the feedback. I'm testing in windows but maybe i need to do it in a clean installation (my windows is plenty of wsl, multiple node installations...). I'll try tomorrow and fix it doesn't worry. The npx json, really is only needed in osx, i maintain for all OSs thinking in future dependencies but for the moment we could enable this check only in OSX. about the mkdir -p i ned to investigate further because removing -p, it fails in OSX ( i think Gruntfile need a lot of rework because a lot of things are not well segmented and this is one of this) , i'll research both things count with it. |
Beta Was this translation helpful? Give feedback.
-
I'm opening an issue with this problems to thread this in the correct place (a bug) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
pre-commit.mp4
Hello everyone!
I have finished integrating the automatic workflows, thanks to @TimRudy who has done a great job of standardization and review to be able to face this autoformatting using Prettier with guarantees.
Now, when we do a commit or a PR, the workflow first reformats the code, this way, we now always have clean and formatted code, following the same guidelines.
In addition to formatting the code, the linter (jshint) is passed.
If the linter fails, the PR or the commit fails and the other automated workflows will stop, this is a big step forward for optimizing github share credits.
On the other hand, we need to ensure commits from the developer with a minimum of quality. So I created a pre-commit script.
With this pre-commit script for git, on each commit the code will be formatted (with the process implemented by @TimRudy ) and the linter will be passed. If something goes wrong, the commit will stop until the developer fixes it.
On your next code update (git pull), when you install dependencies (npm install --legacy-peer-deps) or start the development environment (npm start), your Icestudio git environment will be updated to support this pre-commit.
The script is in scripts/git/pre-commit and during the installation process it is copied as .git/hooks/pre-commit. If you want to add more useful checks until the commit, add them in it.
This effort goes in the direction of standardizing the code and minimizing bugs in the Github repository.
Many thanks to all contributors.
📣 @TimRudy @lmcapacho @jojo535275 @Obijuan @Democrito
Beta Was this translation helpful? Give feedback.
All reactions