pip install pipfile-sort
# Pipfile-sort targets Pipfile on current directory,
# so need to move to the directory where Pipfile exists.
cd /path/to/pipfile/dir
# Rewrite Pipfile as the package lists are sorted.
pipfile-sort
- repo: https://github.com/0xdade/pipfile-sort
rev: v0.2.1
hooks:
- id: pipfile-sort