Skip to content

Commit

Permalink
Set up isort in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Dec 6, 2020
1 parent 73fc2ea commit 6e37208
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Expand Up @@ -75,6 +75,7 @@ jobs:
matrix:
toxenv:
- flake8
- isort

steps:
- name: Git clone
Expand Down
14 changes: 14 additions & 0 deletions setup.cfg
Expand Up @@ -13,3 +13,17 @@ extend-ignore = E131
ignore-bad-ideas =
.#emacsjunk.py
snake.egg-info

[isort]
# from X import (
# a,
# b,
# )
multi_line_output = 3
include_trailing_comma = true
lines_after_imports = 2
reverse_relative = true
default_section = THIRDPARTY
known_first_party = findimports
# known_third_party = pytest, ...
# skip = filename...
3 changes: 2 additions & 1 deletion setup.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python
import ast
import email.utils
import os
import re
import email.utils

from setuptools import setup


Expand Down
6 changes: 4 additions & 2 deletions tests.py
@@ -1,12 +1,14 @@
import os
import unittest

import findimports


try:
from cStringIO import StringIO
except ImportError:
from io import StringIO

import findimports


here = os.path.dirname(__file__)

Expand Down
8 changes: 4 additions & 4 deletions testsuite.py
@@ -1,14 +1,14 @@
#!/usr/bin/python

import unittest
import doctest
import glob
import linecache
import os
import re
import shutil
import sys
import tempfile
import shutil
import glob
import linecache
import unittest


class RedirectToStdout(object):
Expand Down
5 changes: 5 additions & 0 deletions tox.ini
Expand Up @@ -19,3 +19,8 @@ commands =
deps = flake8
skip_install = true
commands = flake8 findimports.py setup.py tests.py testsuite.py

[testenv:isort]
deps = isort
skip_install = true
commands = isort {posargs: -c --diff findimports.py setup.py tests.py testsuite.py}

0 comments on commit 6e37208

Please sign in to comment.