Skip to content

Commit a7943ce

Browse files
committed
Setup import style check
1 parent e5ef722 commit a7943ce

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

.isort.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[settings]
2+
known_first_party = julia
3+
default_section = THIRDPARTY
4+
5+
# Black-compatible setting. See: https://github.com/ambv/black
6+
multi_line_output = 3
7+
include_trailing_comma = True
8+
force_grid_wrap = 0
9+
use_parentheses = True
10+
line_length = 88

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
repos:
2+
- repo: https://github.com/pre-commit/mirrors-isort
3+
rev: v4.3.17
4+
hooks:
5+
- id: isort
26
- repo: https://github.com/ambv/black
37
rev: 19.3b0
48
hooks:

ci/install_pycall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
0, os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir, "src")
66
)
77

8-
import julia
8+
import julia # isort:skip
99

1010
julia.install(color=True)

src/julia/core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# Imports
1414
# ----------------------------------------------------------------------------
1515

16-
# Stdlib
1716
from __future__ import print_function, absolute_import
1817

1918
from logging import getLogger # see `.logger`
@@ -45,9 +44,7 @@ def samefile(f1, f2):
4544
b = os.path.realpath(os.path.normcase(f2))
4645
return a == b
4746

48-
49-
# this is python 3.3 specific
50-
from types import ModuleType
47+
from types import ModuleType # this is python 3.3 specific
5148

5249
from .find_libpython import find_libpython, linked_libpython
5350
from .options import JuliaOptions, options_docs, parse_jl_options

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ changedir = {toxinidir}/docs
6060

6161
[testenv:style]
6262
deps =
63+
isort == 4.3.17
6364
black == 19.3b0
6465
commands =
66+
isort --recursive --check-only .
6567
black . {posargs:--check --diff}

0 commit comments

Comments
 (0)