-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add pre-commit hook #867
Add pre-commit hook #867
Conversation
This will format auto-generated dart files too. Is that the desired behaviour? |
Nice catch, i'll add it to the grep filter command. Creating a contributing.md seems a bit out of scope for this pr |
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.
Lgtm!
I think this should be the desired behaviour; if those are indeed dart files, they should be following the standard formatting convention. This would also simplify the hook as you would only need to run the formatter in the |
Because they are auto generated they shouldn't be changed at all, even though they can conflict with our formatting standards, because they can and probably will regenerate themselves (and be an hassle every time you save them or you commit them). |
In that case, take a look at the linting config to make sure those files are ignored. |
It's not on develop, but #863 already ignores them |
That's great and also needed, but I meant if the formatting check action is ignoring the |
Nice catch! Changed the action to only include user created files |
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.
Running the .sh script doesn't work if there is no hooks folder inside .git folder.
I created the folder, and works fine. Can the .sh create the folder automatically?
Also, the .sh is in the git changed files because it changed the mode from 100644 to 100755. Any idea to ignore that?
I can't seem to replicate this, on my pc, according to the git documentation (link) it automatically populates .git/hooks directory with sample hooks, so the directory is automatically created. I can't also replicate the .sh changed mode on linux. I'm using git version 2.40.1 |
I can track down the file mode change since I use an NTFS partition on a linux distro (in order to work on both enviroments) git sets |
It seems, upon further research that there are some git installations that don't populate the |
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.
Nicely done!
Closes #854
Review checklist
whatsnew/whatsnew-pt-PT
changelog.md
with the change