Skip to content

Commit

Permalink
Setup import style check
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Apr 26, 2019
1 parent e5ef722 commit a7943ce
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
known_first_party = julia
default_section = THIRDPARTY

# Black-compatible setting. See: https://github.com/ambv/black
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
line_length = 88
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
repos:
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.17
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 19.3b0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion ci/install_pycall.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
0, os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir, "src")
)

import julia
import julia # isort:skip

julia.install(color=True)
5 changes: 1 addition & 4 deletions src/julia/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# Imports
# ----------------------------------------------------------------------------

# Stdlib
from __future__ import print_function, absolute_import

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


# this is python 3.3 specific
from types import ModuleType
from types import ModuleType # this is python 3.3 specific

from .find_libpython import find_libpython, linked_libpython
from .options import JuliaOptions, options_docs, parse_jl_options
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ changedir = {toxinidir}/docs

[testenv:style]
deps =
isort == 4.3.17
black == 19.3b0
commands =
isort --recursive --check-only .
black . {posargs:--check --diff}

0 comments on commit a7943ce

Please sign in to comment.