Skip to content

Commit 8a4e4bc

Browse files
format
1 parent 0dcd867 commit 8a4e4bc

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

exasol/toolbox/tools/lint.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import typer
21
import json
3-
from pathlib import Path
4-
from inspect import cleandoc
5-
from dataclasses import dataclass
62
from collections.abc import Iterable
3+
from dataclasses import dataclass
4+
from inspect import cleandoc
5+
from pathlib import Path
6+
7+
import typer
78

89
CLI = typer.Typer()
910

@@ -56,15 +57,13 @@ def _rows(issues: Iterable[LintIssue]) -> str:
5657
rows += f"|{issue.message_id}"
5758
rows += f"|{issue.message}|\n"
5859
return rows
60+
5961
template = cleandoc(
6062
"""
6163
{header}{rows}
6264
"""
6365
)
64-
lint_issues = sorted(
65-
lint_issues,
66-
key=lambda i: (i.path, i.message_id, i.line)
67-
)
66+
lint_issues = sorted(lint_issues, key=lambda i: (i.path, i.message_id, i.line))
6867
return template.format(header=_header(), rows=_rows(lint_issues))
6968

7069

exasol/toolbox/tools/tbx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from exasol.toolbox.tools import (
44
issue,
5+
lint,
56
security,
67
workflow,
7-
lint,
88
)
99

1010
CLI = typer.Typer()

test/unit/lint_test.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import json
2+
13
import pytest
24

35
from exasol.toolbox.tools import lint
4-
import json
6+
57

68
@pytest.mark.parametrize(
79
"data",
@@ -17,9 +19,9 @@
1719
"path": "test_path",
1820
"symbol": "test_symbol",
1921
"message": "test_message",
20-
"message-id": "test_message_id"
22+
"message-id": "test_message_id",
2123
},
22-
]
24+
],
2325
)
2426
def test_lint_issue_from_json(data):
2527
actual = lint.lint_issue_from_json(json.dumps([data]))
@@ -38,6 +40,7 @@ def test_lint_issue_from_json(data):
3840
)
3941
assert list(actual) == [expected]
4042

43+
4144
@pytest.mark.parametrize(
4245
"data,expected",
4346
[
@@ -53,18 +56,18 @@ def test_lint_issue_from_json(data):
5356
"path": "test_path",
5457
"symbol": "test_symbol",
5558
"message": "test_message",
56-
"message-id": "test_message_id"
59+
"message-id": "test_message_id",
5760
},
5861
"""# Static Code Analysis
5962
6063
|File|line<br>column|id|message|
6164
|---|:-:|:-:|---|
6265
|test_path|line: 0<br>column: 1|test_message_id|test_message|
63-
"""
66+
""",
6467
)
65-
]
68+
],
6669
)
67-
def test_lint_issue_to_markdown(data,expected):
70+
def test_lint_issue_to_markdown(data, expected):
6871
issue = lint.LintIssue(
6972
type=data["type"],
7073
module=data["module"],

0 commit comments

Comments
 (0)