2
0
Эх сурвалжийг харах

Add isort configuration

Closes https://projects.torsion.org/witten/borgmatic/issues/169.
Luke Murphy 6 жил өмнө
parent
commit
b94dbff216
4 өөрчлөгдсөн 18 нэмэгдсэн , 0 устгасан
  1. 3 0
      scripts/isort
  2. 8 0
      setup.cfg
  3. 1 0
      test_requirements.txt
  4. 6 0
      tox.ini

+ 3 - 0
scripts/isort

@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+
+isort --recursive --check-only --settings-path setup.cfg .

+ 8 - 0
setup.cfg

@@ -8,3 +8,11 @@ addopts = --cov-report term-missing:skip-covered --cov=borgmatic --ignore=tests/
 [flake8]
 [flake8]
 ignore = E501,W503
 ignore = E501,W503
 exclude = *.*/*
 exclude = *.*/*
+
+[tool:isort]
+force_single_line = False
+include_trailing_comma = True
+known_first_party = borgmatic
+line_length = 100
+multi_line_output = 3
+skip = .tox

+ 1 - 0
test_requirements.txt

@@ -8,6 +8,7 @@ coverage==4.5.1
 docopt==0.6.2
 docopt==0.6.2
 flake8==3.5.0
 flake8==3.5.0
 flexmock==0.10.2
 flexmock==0.10.2
+isort==4.3.19
 mccabe==0.6.1
 mccabe==0.6.1
 more-itertools==4.3.0
 more-itertools==4.3.0
 pluggy==0.7.1
 pluggy==0.7.1

+ 6 - 0
tox.ini

@@ -13,6 +13,7 @@ install_command =
 commands =
 commands =
     pytest
     pytest
     sh scripts/black
     sh scripts/black
+    sh scripts/isort
     flake8 .
     flake8 .
 
 
 [testenv:black]
 [testenv:black]
@@ -24,3 +25,8 @@ commands =
 deps = -rtest_requirements.txt
 deps = -rtest_requirements.txt
 commands =
 commands =
     pytest tests/end-to-end
     pytest tests/end-to-end
+
+[testenv:isort]
+deps = {[testenv]deps}
+commands =
+    isort {posargs:--recursive} --settings-path setup.cfg .