-
Notifications
You must be signed in to change notification settings - Fork 46
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
Update YAML file to fix Prettier - Issue #498 1st Pull Request #520
Conversation
…rrors-isort to pycqa/isort 5.10.1
I am having an issue with the pycqa/isort update to the yaml file. What I did to try to troubleshoot was clean my pre-commit cache, manually install isort, but they did not clear the error. Do you have any suggestions? I will also drop this in tech-help channel on Slack.![]() ![]() When I commented out that particular section of the file, I was able to commit my changes with no problem. Also, I did not run into the Prettier issue!![]() I got information via the tech-help channel, that this is a known issue with isort.![]() ![]() I also looked into the isort documentation and got the following. So, I am thinking that we should delete the seed-isort-config lines from the yaml file.![]() Following the trail from the previous issue about poetry-core affecting isort, I see just a few weeks ago this update was merged. Shall I change isort version and give it a try?![]() I updated the version of isort to 5.12.0, but then the Prettier issue came back!![]() |
@ChasVanDav It looks like with the update to isort, you resolved the dependency issue/error and are at a clean slate for step one, the original formatting issue this works to investigate resolves the formatting conflicts after updating dependencies, going forward |
OMG it worked! I added a post-commit script and that fixed it! |
In regards to pre-commit not automatically staging it's own changes, it appears that this is the intended behavior as allowing anything to automatically commit it's own changes is considered dangerous. You can see more info on this here. ![]() I would advise not going against best practices here and although it's annoying to commit again, you should verify that the changes Prettier made were accurate and do not break your code before committing (I've actually had a linter break my code before in Python fyi and it was a nightmare to chase down). That being said, you can use the Prettier extension to help format your code every time you save so that Prettier won't fail when you go to commit (you can format it it before that point every time you save). More info on that here. |
As per @monikkaelyse's recommendation, I will move to add instructions to the README file with suggestions on mitigating Prettier's post-commit "issue." It seems like this is normal and best practices for prettier to require a second commit. This pull request should be ready for review by EOD! @daaimah123 |
Closing this pull request and creating new pull request with updated README instructions. |
Description:
On the develop branch, commits cannot be pushed seamlessly due to 'Prettier' formatting that happens after git push attempt.
As per the instructions in Issue #498, I updated the yaml file in order to resolve the issue with Prettier adding a commit after attempting a git push. The goal is for prettier to make its formatting updated alongside the commit process and not inhibit developer from pushing changes in one go.
Changes:
I updated the yaml file by changing the following:
- pre-commit/hooks repository: Update to version v4.4.0, which is compatible with Python 3.8.10.
- pycqa/isort repository: Change from mirrors-isort to pycqa/isort. Update to version 5.10.1, which is compatible with Python 3.8.10.
Next Steps:
Once this branch updates are running smoothly, I will test move on to the next steps entailed in the issue description.