Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.27 KB

0004-isort-import-ordering.md

File metadata and controls

58 lines (41 loc) · 1.27 KB
layout status adr title deciders date
page
proposed
0004
Isort Import Formatting

Context and problem statement

Import ordering in Archivematica related projects is inconsistant and can be a distraction from actual content.

The import style described by PEP 8 is good, but not specific enough.

As with code formatting tools, automating import ordering simplifies developer decisions and code review.

Considered options

  • isort - the standard, widely used
  • black - black is considering making import reodering an option, but it hasn't happend yet

Recommendation

isort, because it's well established. If black does add support, it may make sense to move to it.

Recommended format

  • future
  • stdlib
  • third party
  • artefactual libs (e.g metsrw)
  • archivematicaCommon
  • dashboard, mcpclient, mcpserver

For example:

from __future__ import unicode_literals

import os

from lxml import etree
from django import forms
from django.conf import settings

from countryCodes import getCodeForCountry

from main.models import Derivation, File, FPCommandOutput, RightsStatement