Skip to content

A fork of pre-commit-python-sorter that has a tag that works with pre-commit autoupdate, without --bleeding-edge.

License

Notifications You must be signed in to change notification settings

daisylb/pre-commit-python-sorter

 
 

Repository files navigation

Build Status Coverage Status

Pre-commit python module sorter

This is a pre-commit hook that will sort your imports for you (or show you how it should be done).

Add this to your .pre-commit-config.yaml file

- repo: git://github.com/FalconSocial/pre-commit-python-sorter
  sha: 1.0.4
  hooks:
  - id: python-import-sorter
    args: ['--silent-overwrite']

Available flags:

  • --silent-overwrite: The hook won't fail if it has to change files. It will just do it.
  • --check-only: The hook will not change any files.
  • --diff: If imports are not ordered correctly, print a diff of required changes to fix the import order.

The hook supports isort's configuration files - Please refer to the isort documentation for reference

Development: pip install -r requirements-dev.txt

Testing: py.test --cov pre_commit_hook tests/

About

A fork of pre-commit-python-sorter that has a tag that works with pre-commit autoupdate, without --bleeding-edge.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%