summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2020-01-05 17:33:50 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2020-01-05 17:33:50 -0800
commitf02f012c7c13b8caa946d782ef8f6775972972bd (patch)
treed0edafbcbdfc4ea8581b146729c9a2c827d1b975
parent2cb3ec41651ee7f539433d1409933e4125e4925e (diff)
downloadisort-f02f012c7c13b8caa946d782ef8f6775972972bd.tar.gz
Fix issue #812: error reporting incorrect
-rw-r--r--isort/api.py2
-rw-r--r--isort/main.py4
-rw-r--r--tests/test_isort.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/isort/api.py b/isort/api.py
index 99d717eb..bf86cd0e 100644
--- a/isort/api.py
+++ b/isort/api.py
@@ -112,7 +112,7 @@ def check_imports(
print(f"SUCCESS: {file_path or ''} Everything Looks Good!")
return True
else:
- print(f"ERROR: {file_path or ''} Imports are incorrectly sorted.")
+ print(f"ERROR: {file_path or ''} Imports are incorrectly sorted and/or formatted.")
if show_diff:
show_unified_diff(
file_input=file_contents, file_output=sorted_output, file_path=file_path
diff --git a/isort/main.py b/isort/main.py
index dfd09873..5d48f84c 100644
--- a/isort/main.py
+++ b/isort/main.py
@@ -296,8 +296,8 @@ def parse_args(argv: Optional[Sequence[str]] = None) -> Dict[str, Any]:
action="store_true",
help="Turns off default behavior that removes direct imports when as imports exist.",
)
- parser.add_argument("-lai", "--lines-after-imports", dest="lines_after_imports", type=int)
- parser.add_argument("-lbt", "--lines-between-types", dest="lines_between_types", type=int)
+ parser.add_argument("--lai", "--lines-after-imports", dest="lines_after_imports", type=int)
+ parser.add_argument("--lbt", "--lines-between-types", dest="lines_between_types", type=int)
parser.add_argument(
"--le",
"--line-ending",
diff --git a/tests/test_isort.py b/tests/test_isort.py
index e9ca77cf..11a7079f 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -2587,7 +2587,7 @@ def test_strict_whitespace_by_default(capsys) -> None:
test_input = "import os\nfrom django.conf import settings\n"
SortImports(file_contents=test_input, check=True)
out, err = capsys.readouterr()
- assert out == "ERROR: Imports are incorrectly sorted.\n"
+ assert out == "ERROR: Imports are incorrectly sorted and/or formatted.\n"
def test_strict_whitespace_no_closing_newline_issue_676(capsys) -> None: