Skip to content

Commit

Permalink
Revert "Add minimal, black-compatible flake8 configuration (#524)" (#573
Browse files Browse the repository at this point in the history
)
  • Loading branch information
DmitriiDeriabinQB authored Oct 20, 2020
1 parent f5b0991 commit 8942306
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 4 additions & 2 deletions kedro/framework/cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@ def lint(files, check_only):
) from exc

python_call("black", ("--check",) + files if check_only else files)
python_call("flake8", files)
python_call("flake8", ("--max-line-length=88",) + files)

check_flag = ("-c",) if check_only else ()
python_call("isort", (*check_flag, "-rc") + files)
python_call(
"isort", (*check_flag, "-rc", "-tc", "-up", "-fgw=0", "-m=3", "-w=88") + files
)


@project_group.command()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[flake8]
max-line-length=88
extend-ignore=E203

[isort]
multi_line_output=3
include_trailing_comma=True
Expand Down
14 changes: 10 additions & 4 deletions tests/framework/cli/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ def test_lint(
)
expected_calls = [
mocker.call("black", expected_files),
mocker.call("flake8", expected_files),
mocker.call("isort", ("-rc",) + expected_files),
mocker.call("flake8", ("--max-line-length=88",) + expected_files),
mocker.call(
"isort",
("-rc", "-tc", "-up", "-fgw=0", "-m=3", "-w=88") + expected_files,
),
]

assert python_call_mock.call_args_list == expected_calls
Expand Down Expand Up @@ -198,8 +201,11 @@ def test_lint_check_only(
)
expected_calls = [
mocker.call("black", ("--check",) + expected_files),
mocker.call("flake8", expected_files),
mocker.call("isort", ("-c", "-rc") + expected_files),
mocker.call("flake8", ("--max-line-length=88",) + expected_files),
mocker.call(
"isort",
("-c", "-rc", "-tc", "-up", "-fgw=0", "-m=3", "-w=88") + expected_files,
),
]

assert python_call_mock.call_args_list == expected_calls
Expand Down

0 comments on commit 8942306

Please sign in to comment.