Skip to content

Commit de33245

Browse files
committed
Reformatted files with isort
1 parent 1c1f2a4 commit de33245

12 files changed

+39
-35
lines changed

src/tctools/__main__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import argparse
22

3-
43
if __name__ == "__main__":
54
parser = argparse.ArgumentParser(
65
prog="tctools",

src/tctools/common.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from abc import ABC, abstractmethod
2-
from typing import Optional, List
3-
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
4-
from pathlib import Path
5-
from lxml import etree
61
import logging
72
import sys
3+
from abc import ABC, abstractmethod
4+
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
5+
from pathlib import Path
6+
from typing import List, Optional
87

8+
from lxml import etree
99

1010
# Create type hinting shortcuts:
1111
Element = etree._Element # noqa

src/tctools/format/format_class.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
from editorconfig import get_properties
2-
from typing import List, Tuple, Type, Optional
3-
from collections import OrderedDict
41
import re
2+
from collections import OrderedDict
3+
from typing import List, Optional, Tuple, Type
4+
5+
from editorconfig import get_properties
56

67
from ..common import TcTool
8+
from .format_extras import Kind
79
from .format_rules import (
8-
FormattingRule,
10+
FormatConditionalParentheses,
11+
FormatEndOfLine,
12+
FormatInsertFinalNewline,
913
FormatTabs,
14+
FormattingRule,
1015
FormatTrailingWhitespace,
11-
FormatInsertFinalNewline,
12-
FormatEndOfLine,
1316
FormatVariablesAlign,
14-
FormatConditionalParentheses,
1517
)
16-
from .format_extras import Kind
17-
1818

1919
RowCol = Tuple[int, int]
2020
Segment = Tuple[Kind, List[str], str]

src/tctools/format/format_rules.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
from typing import List, Dict, OrderedDict, Tuple, Optional, Type, Any
2-
from abc import ABC, abstractmethod
3-
import re
41
import math
2+
import re
3+
from abc import ABC, abstractmethod
4+
from typing import Any, Dict, List, Optional, OrderedDict, Tuple, Type
55

66
from .format_extras import Kind
77

8-
98
Correction = Tuple[int, str]
109

1110

src/tctools/git_info/git_info_class.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
from pathlib import Path
12
from typing import Dict
3+
24
from git import Repo
3-
from pathlib import Path
45

56
from ..common import Tool
67

src/tctools/make_release/make_release_class.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
from typing import Optional, List
21
import re
2+
import shutil
33
from pathlib import Path
44
from tempfile import TemporaryDirectory
5-
import shutil
6-
from lxml import etree
5+
from typing import List, Optional
6+
77
from git import Repo
8+
from lxml import etree
89

910
from ..common import Tool
1011

11-
1212
ElementTree = etree._ElementTree # noqa
1313
Element = etree._Element # noqa
1414

src/tctools/xml_sort/xml_sort_class.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import re
12
from typing import Dict
3+
24
from lxml import etree
3-
import re
45

5-
from ..common import TcTool, Element
6+
from ..common import Element, TcTool
67

78

89
class XmlSorter(TcTool):

tests/conftest.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
Configuration for these tests.
33
"""
44

5-
import pytest
65
import shutil
76
from pathlib import Path
87
from typing import List
98

9+
import pytest
10+
1011

1112
@pytest.fixture
1213
def plc_code(tmp_path):

tests/test_formatter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import pytest
21
import subprocess
32
import sys
43

4+
import pytest
5+
56
import tctools.format.__main__
67
from tctools.format.format_class import Formatter
78

tests/test_git_info.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import pytest
1+
import re
22
import subprocess
33
import sys
44
from pathlib import Path
5-
import re
5+
6+
import pytest
67

78
import tctools.git_info.__main__
89
from tctools.git_info.git_info_class import GitInfo

tests/test_make_release.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import pytest
2-
import sys
31
import os
4-
import subprocess
52
import shutil
3+
import subprocess
4+
import sys
65
from pathlib import Path
76

7+
import pytest
8+
89
import tctools.make_release.__main__
910
from tctools.make_release.make_release_class import MakeRelease
1011

11-
1212
VERSION = "v1.2.3"
1313

1414

tests/test_xml_sorter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import pytest
21
import subprocess
32
import sys
43

4+
import pytest
5+
56
from tctools.xml_sort.__main__ import main as xml_sort_main
67
from tctools.xml_sort.xml_sort_class import XmlSorter
78

0 commit comments

Comments
 (0)