[meld/precommit: 6/11] Move from flake8-import-order to isort



commit 6edbe7e861b0b6ea4cb721154fabee50b0900776
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 6 07:01:19 2019 +1000

    Move from flake8-import-order to isort
    
    isort offers two main benefits: it automatically sorts and formats, and
    it has better configuration for some import order details.
    Specifically, this has changed the import order such that CONST and
    Class imports come before variable imports in `from` import lines, and
    more aggressively wraps multi-line imports.
    
    The other formatting change here is to enforce a number of lines after
    the end of import statements, which also improves consistency.

 .pre-commit-config.yaml       |  2 +-
 dev-requirements.txt          |  2 +-
 help/C/buildwebhelp.py        |  1 -
 meld/actiongutter.py          |  5 +----
 meld/chunkmap.py              |  4 +---
 meld/diffgrid.py              |  4 +---
 meld/dirdiff.py               | 14 ++++++--------
 meld/filediff.py              | 25 ++++++++++++++-----------
 meld/gutterrendererchunk.py   |  4 +---
 meld/iohelpers.py             |  4 +---
 meld/linkmap.py               |  4 +---
 meld/matchers/diffutil.py     |  6 ++++--
 meld/matchers/helpers.py      |  1 -
 meld/meldapp.py               |  5 +----
 meld/meldbuffer.py            |  5 +----
 meld/melddoc.py               |  6 +-----
 meld/meldwindow.py            |  7 ++-----
 meld/misc.py                  |  5 ++---
 meld/newdifftab.py            |  5 +----
 meld/patchdialog.py           |  6 +-----
 meld/preferences.py           |  6 +-----
 meld/recent.py                |  4 +---
 meld/settings.py              |  5 +----
 meld/sourceview.py            |  8 +-------
 meld/style.py                 | 11 +++--------
 meld/tree.py                  | 28 ++++++++++++++++++++--------
 meld/ui/bufferselectors.py    |  4 +---
 meld/ui/cellrenderers.py      |  3 +--
 meld/ui/emblemcellrenderer.py |  5 +----
 meld/ui/filechooser.py        |  4 +---
 meld/ui/findbar.py            |  4 +---
 meld/ui/historyentry.py       |  5 +----
 meld/ui/notebook.py           |  5 +----
 meld/ui/notebooklabel.py      |  4 +---
 meld/ui/recentselector.py     |  3 +--
 meld/ui/statusbar.py          |  8 ++------
 meld/ui/util.py               |  4 +---
 meld/ui/vcdialogs.py          |  5 +----
 meld/undo.py                  |  1 -
 meld/vc/_vc.py                |  3 +--
 meld/vc/git.py                |  1 -
 meld/vcview.py                |  7 +------
 meld/windowstate.py           |  1 -
 setup.cfg                     | 14 +++++++++++---
 test/test_buffer_lines.py     |  1 -
 test/test_matchers.py         |  1 +
 test/test_misc.py             |  1 +
 47 files changed, 96 insertions(+), 165 deletions(-)
---
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 58f046c2..f42e6030 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -27,6 +27,6 @@ repos:
     hooks:
     -   id: flake8
         additional_dependencies:
-          - flake8-import-order
+          - flake8-isort
           - pep8-naming
           - pycodestyle
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 3f89718a..079260e3 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,5 +1,5 @@
 flake8==3.7.5
-flake8-import-order==0.16
+flake8-isort==2.7.0
 mccabe==0.6.1
 pep8-naming==0.4.1
 pycodestyle==2.5.0
diff --git a/help/C/buildwebhelp.py b/help/C/buildwebhelp.py
index f4f8dfec..7be7f81e 100755
--- a/help/C/buildwebhelp.py
+++ b/help/C/buildwebhelp.py
@@ -7,7 +7,6 @@ import sys
 
 from bs4 import BeautifulSoup
 
-
 JEKYLL_HEADER = """---
 layout: help
 title: Meld - Help
diff --git a/meld/actiongutter.py b/meld/actiongutter.py
index ec03f394..1cf276da 100644
--- a/meld/actiongutter.py
+++ b/meld/actiongutter.py
@@ -16,10 +16,7 @@
 import bisect
 from typing import Dict, Optional
 
-from gi.repository import Gdk
-from gi.repository import GdkPixbuf
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, GdkPixbuf, GObject, Gtk
 
 from meld.conf import _
 from meld.const import ActionMode, ChunkAction
diff --git a/meld/chunkmap.py b/meld/chunkmap.py
index b3fc0d8a..1f295609 100644
--- a/meld/chunkmap.py
+++ b/meld/chunkmap.py
@@ -18,9 +18,7 @@ import logging
 from typing import List, Mapping, Tuple
 
 import cairo
-from gi.repository import Gdk
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, GObject, Gtk
 
 from meld.settings import get_meld_settings
 from meld.style import get_common_theme
diff --git a/meld/diffgrid.py b/meld/diffgrid.py
index 3b4a8ba8..c03e4ab7 100644
--- a/meld/diffgrid.py
+++ b/meld/diffgrid.py
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from gi.repository import Gdk
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, GObject, Gtk
 
 
 class DiffGrid(Gtk.Grid):
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index f8a36709..5d5c7428 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -26,15 +26,10 @@ from collections import namedtuple
 from decimal import Decimal
 from mmap import ACCESS_COPY, mmap
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, Gio, GLib, GObject, Gtk
 
 # TODO: Don't from-import whole modules
-from meld import misc
-from meld import tree
+from meld import misc, tree
 from meld.conf import _
 from meld.const import FILE_FILTER_ACTION_FORMAT, MISSING_TIMESTAMP
 from meld.iohelpers import trash_or_confirm
@@ -44,7 +39,10 @@ from meld.recent import RecentType
 from meld.settings import bind_settings, get_meld_settings, settings
 from meld.treehelpers import refocus_deleted_path, tree_path_as_tuple
 from meld.ui.cellrenderers import (
-    CellRendererByteSize, CellRendererDate, CellRendererFileMode)
+    CellRendererByteSize,
+    CellRendererDate,
+    CellRendererFileMode,
+)
 from meld.ui.emblemcellrenderer import EmblemCellRenderer
 from meld.ui.util import map_widgets_into_lists
 
diff --git a/meld/filediff.py b/meld/filediff.py
index 49de138d..717c0a14 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -19,21 +19,16 @@ import functools
 import logging
 import math
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import GtkSource
+from gi.repository import Gdk, Gio, GLib, GObject, Gtk, GtkSource
 
 # TODO: Don't from-import whole modules
 from meld import misc
 from meld.conf import _
 from meld.const import (
-    ActionMode,
-    ChunkAction,
     NEWLINES,
     TEXT_FILTER_ACTION_FORMAT,
+    ActionMode,
+    ChunkAction,
 )
 from meld.gutterrendererchunk import GutterRendererChunkLines
 from meld.iohelpers import prompt_save_filename
@@ -41,18 +36,26 @@ from meld.matchers.diffutil import Differ, merged_chunk_order
 from meld.matchers.helpers import CachedSequenceMatcher
 from meld.matchers.merge import Merger
 from meld.meldbuffer import (
-    BufferDeletionAction, BufferInsertionAction, BufferLines)
+    BufferDeletionAction,
+    BufferInsertionAction,
+    BufferLines,
+)
 from meld.melddoc import ComparisonState, MeldDoc
 from meld.misc import user_critical, with_focused_pane
 from meld.patchdialog import PatchDialog
 from meld.recent import RecentType
 from meld.settings import bind_settings, get_meld_settings
 from meld.sourceview import (
-    get_custom_encoding_candidates, LanguageManager, TextviewLineAnimationType)
+    LanguageManager,
+    TextviewLineAnimationType,
+    get_custom_encoding_candidates,
+)
 from meld.ui.filechooser import MeldFileChooserDialog
 from meld.ui.findbar import FindBar
 from meld.ui.util import (
-    make_multiobject_property_action, map_widgets_into_lists)
+    make_multiobject_property_action,
+    map_widgets_into_lists,
+)
 from meld.undo import UndoSequence
 
 log = logging.getLogger(__name__)
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index f72da451..baea2d20 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -15,9 +15,7 @@
 
 import math
 
-from gi.repository import Gdk
-from gi.repository import GtkSource
-from gi.repository import Pango
+from gi.repository import Gdk, GtkSource, Pango
 
 from meld.settings import get_meld_settings
 from meld.style import get_common_theme
diff --git a/meld/iohelpers.py b/meld/iohelpers.py
index 87213a94..ffa162e4 100644
--- a/meld/iohelpers.py
+++ b/meld/iohelpers.py
@@ -1,9 +1,7 @@
 
 from typing import Optional
 
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import Gtk
+from gi.repository import Gio, GLib, Gtk
 
 from meld.conf import _
 from meld.misc import get_modal_parent, modal_dialog
diff --git a/meld/linkmap.py b/meld/linkmap.py
index 075d60d0..c131f43b 100644
--- a/meld/linkmap.py
+++ b/meld/linkmap.py
@@ -17,13 +17,11 @@
 
 import math
 
-from gi.repository import Gdk
-from gi.repository import Gtk
+from gi.repository import Gdk, Gtk
 
 from meld.settings import get_meld_settings
 from meld.style import get_common_theme
 
-
 # Rounded rectangle corner radius for culled changes display
 RADIUS = 3
 
diff --git a/meld/matchers/diffutil.py b/meld/matchers/diffutil.py
index 8c325272..2ac87c26 100644
--- a/meld/matchers/diffutil.py
+++ b/meld/matchers/diffutil.py
@@ -17,8 +17,10 @@
 from gi.repository import GObject
 
 from meld.matchers.myers import (
-    DiffChunk, MyersSequenceMatcher, SyncPointMyersSequenceMatcher)
-
+    DiffChunk,
+    MyersSequenceMatcher,
+    SyncPointMyersSequenceMatcher,
+)
 
 opcode_reverse = {
     "replace": "replace",
diff --git a/meld/matchers/helpers.py b/meld/matchers/helpers.py
index 4c8af6a4..3a3d1372 100644
--- a/meld/matchers/helpers.py
+++ b/meld/matchers/helpers.py
@@ -8,7 +8,6 @@ from gi.repository import GLib
 
 from meld.matchers import myers
 
-
 log = logging.getLogger(__name__)
 
 
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 122a72ad..a3def9ce 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -19,10 +19,7 @@ import logging
 import optparse
 import os
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import Gtk
+from gi.repository import Gdk, Gio, GLib, Gtk
 
 import meld.accelerators
 import meld.conf
diff --git a/meld/meldbuffer.py b/meld/meldbuffer.py
index 33dfb861..958c99dc 100644
--- a/meld/meldbuffer.py
+++ b/meld/meldbuffer.py
@@ -16,10 +16,7 @@
 
 import logging
 
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import GtkSource
+from gi.repository import Gio, GLib, GObject, GtkSource
 
 from meld.conf import _
 from meld.settings import bind_settings
diff --git a/meld/melddoc.py b/meld/melddoc.py
index 8f7d0bab..bbfa002d 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -23,11 +23,7 @@ import subprocess
 import sys
 from typing import Iterable, Sequence
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, Gio, GLib, GObject, Gtk
 
 from meld.conf import _
 from meld.recent import RecentType
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index 1192072d..00c4adf9 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -17,10 +17,7 @@
 import logging
 import os
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import Gtk
+from gi.repository import Gdk, Gio, GLib, Gtk
 
 # Import support module to get all builder-constructed widgets in the namespace
 import meld.ui.gladesupport  # noqa: F401
@@ -33,7 +30,7 @@ from meld.filemerge import FileMerge
 from meld.melddoc import ComparisonState, MeldDoc
 from meld.menuhelpers import replace_menu_section
 from meld.newdifftab import NewDiffTab
-from meld.recent import recent_comparisons, RecentType
+from meld.recent import RecentType, recent_comparisons
 from meld.settings import get_meld_settings
 from meld.task import LifoScheduler
 from meld.ui.notebooklabel import NotebookLabel
diff --git a/meld/misc.py b/meld/misc.py
index c727f57f..4a849b03 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -26,6 +26,7 @@ import shutil
 import subprocess
 from pathlib import PurePath
 from typing import (
+    TYPE_CHECKING,
     AnyStr,
     Callable,
     Generator,
@@ -34,12 +35,10 @@ from typing import (
     Pattern,
     Sequence,
     Tuple,
-    TYPE_CHECKING,
     Union,
 )
 
-from gi.repository import GLib
-from gi.repository import Gtk
+from gi.repository import GLib, Gtk
 
 from meld.conf import _
 
diff --git a/meld/newdifftab.py b/meld/newdifftab.py
index 89659c31..a619013a 100644
--- a/meld/newdifftab.py
+++ b/meld/newdifftab.py
@@ -15,10 +15,7 @@
 
 import enum
 
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gio, GLib, GObject, Gtk
 
 from meld.conf import _
 from meld.melddoc import LabeledObjectMixin, MeldDoc
diff --git a/meld/patchdialog.py b/meld/patchdialog.py
index 7ed2032e..83c43543 100644
--- a/meld/patchdialog.py
+++ b/meld/patchdialog.py
@@ -17,11 +17,7 @@
 import difflib
 import os
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import Gtk
-from gi.repository import GtkSource
+from gi.repository import Gdk, Gio, GLib, Gtk, GtkSource
 
 from meld.conf import _
 from meld.iohelpers import prompt_save_filename
diff --git a/meld/preferences.py b/meld/preferences.py
index fe99c1d9..cf8b9def 100644
--- a/meld/preferences.py
+++ b/meld/preferences.py
@@ -14,11 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import GtkSource
+from gi.repository import Gio, GLib, GObject, Gtk, GtkSource
 
 from meld.conf import _
 from meld.filters import FilterEntry
diff --git a/meld/recent.py b/meld/recent.py
index 4a63607e..3c361818 100644
--- a/meld/recent.py
+++ b/meld/recent.py
@@ -31,9 +31,7 @@ import sys
 import tempfile
 from typing import List, Tuple
 
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import Gtk
+from gi.repository import Gio, GLib, Gtk
 
 import meld.misc
 from meld.conf import _
diff --git a/meld/settings.py b/meld/settings.py
index 4a1b6a57..fc68e3da 100644
--- a/meld/settings.py
+++ b/meld/settings.py
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from gi.repository import Gio
-from gi.repository import GObject
-from gi.repository import GtkSource
-from gi.repository import Pango
+from gi.repository import Gio, GObject, GtkSource, Pango
 
 import meld.conf
 import meld.filters
diff --git a/meld/sourceview.py b/meld/sourceview.py
index 7da3b01b..f3cca30f 100644
--- a/meld/sourceview.py
+++ b/meld/sourceview.py
@@ -17,18 +17,12 @@
 import logging
 from enum import Enum
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import GtkSource
+from gi.repository import Gdk, Gio, GLib, GObject, Gtk, GtkSource
 
 from meld.meldbuffer import MeldBuffer
 from meld.settings import bind_settings, get_meld_settings, settings
 from meld.style import colour_lookup_with_fallback, get_common_theme
 
-
 log = logging.getLogger(__name__)
 
 
diff --git a/meld/style.py b/meld/style.py
index 27a6aed0..0da89645 100644
--- a/meld/style.py
+++ b/meld/style.py
@@ -16,14 +16,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import enum
-from typing import (
-    Mapping,
-    Optional,
-    Tuple,
-)
-
-from gi.repository import Gdk
-from gi.repository import GtkSource
+from typing import Mapping, Optional, Tuple
+
+from gi.repository import Gdk, GtkSource
 
 from meld.conf import _
 
diff --git a/meld/tree.py b/meld/tree.py
index fcee1601..b78a4eb7 100644
--- a/meld/tree.py
+++ b/meld/tree.py
@@ -17,18 +17,30 @@
 import os
 
 from gi.module import get_introspection_module
-from gi.repository import Gdk
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Pango
+from gi.repository import Gdk, GLib, GObject, Pango
 
 from meld.style import colour_lookup_with_fallback
 from meld.treehelpers import SearchableTreeStore
 from meld.vc._vc import (  # noqa: F401
-    CONFLICT_BASE, CONFLICT_LOCAL, CONFLICT_MERGED, CONFLICT_OTHER,
-    CONFLICT_REMOTE, CONFLICT_THIS, STATE_CONFLICT, STATE_EMPTY, STATE_ERROR,
-    STATE_IGNORED, STATE_MAX, STATE_MISSING, STATE_MODIFIED, STATE_NEW,
-    STATE_NOCHANGE, STATE_NONE, STATE_NONEXIST, STATE_NORMAL, STATE_REMOVED,
+    CONFLICT_BASE,
+    CONFLICT_LOCAL,
+    CONFLICT_MERGED,
+    CONFLICT_OTHER,
+    CONFLICT_REMOTE,
+    CONFLICT_THIS,
+    STATE_CONFLICT,
+    STATE_EMPTY,
+    STATE_ERROR,
+    STATE_IGNORED,
+    STATE_MAX,
+    STATE_MISSING,
+    STATE_MODIFIED,
+    STATE_NEW,
+    STATE_NOCHANGE,
+    STATE_NONE,
+    STATE_NONEXIST,
+    STATE_NORMAL,
+    STATE_REMOVED,
 )
 
 _GIGtk = None
diff --git a/meld/ui/bufferselectors.py b/meld/ui/bufferselectors.py
index 03c5c1c9..c7260f9a 100644
--- a/meld/ui/bufferselectors.py
+++ b/meld/ui/bufferselectors.py
@@ -1,7 +1,5 @@
 
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import GtkSource
+from gi.repository import GObject, Gtk, GtkSource
 
 from meld.conf import _
 
diff --git a/meld/ui/cellrenderers.py b/meld/ui/cellrenderers.py
index 13326add..24824894 100644
--- a/meld/ui/cellrenderers.py
+++ b/meld/ui/cellrenderers.py
@@ -15,8 +15,7 @@
 
 import datetime
 
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import GObject, Gtk
 
 
 class CellRendererDate(Gtk.CellRendererText):
diff --git a/meld/ui/emblemcellrenderer.py b/meld/ui/emblemcellrenderer.py
index 4cebd040..1c451435 100644
--- a/meld/ui/emblemcellrenderer.py
+++ b/meld/ui/emblemcellrenderer.py
@@ -17,10 +17,7 @@
 from typing import Dict, Tuple
 
 import cairo
-from gi.repository import Gdk
-from gi.repository import GdkPixbuf
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, GdkPixbuf, GObject, Gtk
 
 
 class EmblemCellRenderer(Gtk.CellRenderer):
diff --git a/meld/ui/filechooser.py b/meld/ui/filechooser.py
index 639a0a2d..9616adb9 100644
--- a/meld/ui/filechooser.py
+++ b/meld/ui/filechooser.py
@@ -17,12 +17,10 @@
 
 import sys
 
-from gi.repository import Gtk
-from gi.repository import GtkSource
+from gi.repository import Gtk, GtkSource
 
 from meld.conf import _
 
-
 FILE_ACTIONS = {
     Gtk.FileChooserAction.OPEN,
     Gtk.FileChooserAction.SAVE,
diff --git a/meld/ui/findbar.py b/meld/ui/findbar.py
index 7e2bd2a1..8d95a3d9 100644
--- a/meld/ui/findbar.py
+++ b/meld/ui/findbar.py
@@ -14,9 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import GtkSource
+from gi.repository import GObject, Gtk, GtkSource
 
 
 @Gtk.Template(resource_path='/org/gnome/meld/ui/findbar.ui')
diff --git a/meld/ui/historyentry.py b/meld/ui/historyentry.py
index ee340797..a83d05c7 100644
--- a/meld/ui/historyentry.py
+++ b/meld/ui/historyentry.py
@@ -17,10 +17,7 @@ import configparser
 import os
 import sys
 
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import Pango
+from gi.repository import GLib, GObject, Gtk, Pango
 
 # This file started off as a Python translation of:
 #  * gedit/gedit/gedit-history-entry.c
diff --git a/meld/ui/notebook.py b/meld/ui/notebook.py
index 930548e2..90e185cf 100644
--- a/meld/ui/notebook.py
+++ b/meld/ui/notebook.py
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, Gio, GObject, Gtk
 
 KEYBINDING_FLAGS = GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION
 
diff --git a/meld/ui/notebooklabel.py b/meld/ui/notebooklabel.py
index 2191a25b..33482f27 100644
--- a/meld/ui/notebooklabel.py
+++ b/meld/ui/notebooklabel.py
@@ -14,9 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from gi.repository import Gdk
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gdk, GObject, Gtk
 
 
 @Gtk.Template(resource_path='/org/gnome/meld/ui/notebook-label.ui')
diff --git a/meld/ui/recentselector.py b/meld/ui/recentselector.py
index ff96619b..eaafafcf 100644
--- a/meld/ui/recentselector.py
+++ b/meld/ui/recentselector.py
@@ -14,8 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import GObject, Gtk
 
 from meld.recent import RecentFiles
 
diff --git a/meld/ui/statusbar.py b/meld/ui/statusbar.py
index f00a30bb..0852b661 100644
--- a/meld/ui/statusbar.py
+++ b/meld/ui/statusbar.py
@@ -13,14 +13,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import GtkSource
-from gi.repository import Pango
+from gi.repository import GObject, Gtk, GtkSource, Pango
 
 from meld.conf import _
-from meld.ui.bufferselectors import EncodingSelector
-from meld.ui.bufferselectors import SourceLangSelector
+from meld.ui.bufferselectors import EncodingSelector, SourceLangSelector
 
 
 class MeldStatusMenuButton(Gtk.MenuButton):
diff --git a/meld/ui/util.py b/meld/ui/util.py
index a2f15f36..5fb1e1c4 100644
--- a/meld/ui/util.py
+++ b/meld/ui/util.py
@@ -16,9 +16,7 @@
 import logging
 from typing import List
 
-from gi.repository import Gio
-from gi.repository import GObject
-from gi.repository import Gtk
+from gi.repository import Gio, GObject, Gtk
 
 log = logging.getLogger(__name__)
 
diff --git a/meld/ui/vcdialogs.py b/meld/ui/vcdialogs.py
index 9721286e..a26f7130 100644
--- a/meld/ui/vcdialogs.py
+++ b/meld/ui/vcdialogs.py
@@ -17,10 +17,7 @@
 import os
 import textwrap
 
-from gi.repository import Gio
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import Pango
+from gi.repository import Gio, GObject, Gtk, Pango
 
 from meld.conf import _
 from meld.settings import get_meld_settings, settings
diff --git a/meld/undo.py b/meld/undo.py
index 9e7dbc43..9117a79a 100644
--- a/meld/undo.py
+++ b/meld/undo.py
@@ -36,7 +36,6 @@ import weakref
 
 from gi.repository import GObject
 
-
 log = logging.getLogger(__name__)
 
 
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index f26828f5..54a66b8d 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -31,8 +31,7 @@ import subprocess
 import tempfile
 from typing import ClassVar
 
-from gi.repository import Gio
-from gi.repository import GLib
+from gi.repository import Gio, GLib
 
 from meld.conf import _
 
diff --git a/meld/vc/git.py b/meld/vc/git.py
index d388557e..2e505a19 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -37,7 +37,6 @@ from collections import defaultdict
 from meld.conf import _, ngettext
 from . import _vc
 
-
 NULL_SHA = "0000000000000000000000000000000000000000"
 
 
diff --git a/meld/vcview.py b/meld/vcview.py
index 1c936a36..d30feaa1 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -23,12 +23,7 @@ import stat
 import sys
 import tempfile
 
-from gi.repository import Gdk
-from gi.repository import Gio
-from gi.repository import GLib
-from gi.repository import GObject
-from gi.repository import Gtk
-from gi.repository import Pango
+from gi.repository import Gdk, Gio, GLib, GObject, Gtk, Pango
 
 from meld import tree
 from meld.conf import _
diff --git a/meld/windowstate.py b/meld/windowstate.py
index e11efbc5..e71f5779 100644
--- a/meld/windowstate.py
+++ b/meld/windowstate.py
@@ -18,7 +18,6 @@ from gi.repository import Gdk, Gio, GObject
 
 from meld.settings import load_settings_schema
 
-
 WINDOW_STATE_SCHEMA = 'org.gnome.meld.WindowState'
 
 
diff --git a/setup.cfg b/setup.cfg
index de605d0d..276cc076 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,12 +4,20 @@
 exclude =
     build_helpers.py
 
-# Import order check settings
-import-order-style = edited
-application-import-names = meld
 
 
 # build_helpers is almost entirely distutils interactions, which have
 # poor type hinting
 [mypy-meld.build_helpers]
 ignore_errors = True
+
+[isort]
+known_first_party = meld
+default_section = THIRDPARTY
+no_lines_before = LOCALFOLDER
+multi_line_output = 3
+order_by_type = True
+use_parentheses = True
+indent = 4
+include_trailing_comma = True
+skip = bin/meld
diff --git a/test/test_buffer_lines.py b/test/test_buffer_lines.py
index 3252b03c..73b096a3 100644
--- a/test/test_buffer_lines.py
+++ b/test/test_buffer_lines.py
@@ -5,7 +5,6 @@ import pytest
 
 from meld.meldbuffer import BufferLines, MeldBuffer
 
-
 text = ("""0
 1
 2
diff --git a/test/test_matchers.py b/test/test_matchers.py
index 91c36c0c..086b600e 100644
--- a/test/test_matchers.py
+++ b/test/test_matchers.py
@@ -1,5 +1,6 @@
 
 import unittest
+
 from meld.matchers import myers
 
 
diff --git a/test/test_misc.py b/test/test_misc.py
index 7ab6ff45..8a5d5020 100644
--- a/test/test_misc.py
+++ b/test/test_misc.py
@@ -2,6 +2,7 @@
 from unittest import mock
 
 import pytest
+
 from meld.misc import all_same, calc_syncpoint, merge_intervals
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]