Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Add an isort configuration to sort imports according to Django style guide #119

Open
kelseyq opened this issue Jun 29, 2016 · 2 comments
Open

Comments

@kelseyq
Copy link
Collaborator

kelseyq commented Jun 29, 2016

Django style guide and Two Scoops of Django suggest sorting imports in the following way:

  1. Standard library imports
  2. Imports from core Django.
  3. Imports from third-party apps including those unrelated to Django.
    4. Imports from other Django apps in your project (not sure we can generate anything for this)
  4. Local imports

We can use isort to do this sorting automatically. This commit should add an isort dependency in requirements_dev.txt, add an isort section in setup.cfg that sorts the imports correctly, and include instructions in CONTRIBUTING.rst for running isort before contributing.

@EmadMokhtar
Copy link

@kelseyq is the setup.cfg for the project itself or for the generated package?

@kelseyq
Copy link
Collaborator Author

kelseyq commented Sep 26, 2016

@EmadMokhtar I was thinking for the generated package, but we could use both!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants