Skip to content

Commit

Permalink
Fixed linting and test compatibility with Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-DEMCON committed Sep 12, 2023
1 parent 97dc939 commit 51994a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
8 changes: 1 addition & 7 deletions src/tctools/format_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
import re

from .common import TcTool
from .format_rules import (
FormattingRule,
FormatTabs,
FormatTrailingWhitespace,
FormatInsertFinalNewline,
FormatEndOfLine,
)
from .format_rules import FormattingRule


logger = getLogger("formatter")
Expand Down
7 changes: 0 additions & 7 deletions src/tctools/format_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,3 @@ def format(self, content: List[str]):
self.add_correction(
f"{count} line endings need to be corrected to {eol}`", 0
)


class FormatWhitespaceAlign(FormattingRule):
"""Assert whitespace aligns between code blocks.
Most typical usage is in input/output lists.
"""
4 changes: 3 additions & 1 deletion tests/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ def test_reformat_eol(plc_code, eol):
]

file = plc_code / "TwinCAT Project1" / "MyPlc" / "POUs" / f"FB_Test.TcPOU"
file.write_text(write_eol.join(content_list), newline="")
file.write_bytes(
write_eol.join(content_list).encode()
)

tctools.format.main(str(file))

Expand Down

0 comments on commit 51994a8

Please sign in to comment.