Skip to content
A pre-commit hook to sort your Python imports.
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
tests Add test Dec 23, 2015
.pre-commit-hooks.yaml Fix #16 -- add .pre-commit-hooks.yaml for pre-commit update Jan 26, 2017
.travis.yml Add resources folder, and a README to explain why it's there, remove … Sep 24, 2014
LICENSE.txt Add LICENSE.txt, update version to 0.0.1 Sep 24, 2014
hooks.yaml No need for group in hooks.yaml-files: Sep 23, 2014
setup.cfg initial commit Sep 23, 2014

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://
  sha: 1.0.4
  - 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/

You can’t perform that action at this time.