September 12-18, 2021 in Darker: Pre-commit integration challenges and isort compatibility #658
akaihola
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This week, we focused on addressing compatibility issues and improving integration with popular development tools. A significant challenge emerged with pre-commit integration (#180), where users encountered an error when running Darker as a pre-commit hook on the git HEAD commit. The error message indicated a conflict between the pre-commit configuration and Darker's argument handling, specifically related to the
-r/--revision
argument.In response to this issue, we've begun exploring potential solutions. One proposal suggests allowing Darker to modify files when called by pre-commit under specific conditions, using a special
--revision=:PRE-COMMIT:
flag and$PRE_COMMIT_TO_REF=HEAD
environment variable. This approach aims to balance functionality with safeguarding against potential data loss. We're carefully considering the implications of this change to ensure it doesn't lead to unexpected behavior for users.Additionally, we addressed a compatibility issue with older versions of isort (#157). Users reported crashes when using Darker 1.2.4 with isort versions lower than 5.0. This highlights the importance of maintaining compatibility with various versions of our dependencies while encouraging users to stay up-to-date with the latest releases.
Beta Was this translation helpful? Give feedback.
All reactions