darker

Apply Black code formatting only to changed regions since last git commit

brewmacoslinux
Try with needOr install directly
Source

About

Apply Black formatting only in regions changed since last commit

Commands

darker

Examples

format only modified code in current directory$ darker .
format changed code and show what would be changed$ darker --diff .
format specific Python file changes$ darker path/to/file.py
format changes and check for errors without modifying files$ darker --check .
format changes compared to specific git branch$ darker --revision main .