More ruff checks

This commit is contained in:
Paul Warren 2024-10-14 19:59:54 +11:00
parent f6f7a4ae29
commit 733997f247
3 changed files with 5 additions and 6 deletions

View file

@ -32,10 +32,10 @@ Issues = "https://git.pwarren.id.au/pwarren/PyFroniusReg/issues"
[tool.ruff] [tool.ruff]
# Set the maximum line length to 79. # Set the maximum line length to 79.
line-length = 79 line-length = 99
[tool.ruff.lint] [tool.ruff.lint]
# Add the `line-too-long` rule to the enforced rule set. By default, Ruff omits rules that # Add the `line-too-long` rule to the enforced rule set. By default, Ruff omits rules that
# overlap with the use of a formatter, like Black, but we can override this behavior by # overlap with the use of a formatter, like Black, but we can override this behavior by
# explicitly adding the rule. # explicitly adding the rule.
extend-select = ["E501"] extend-select = ["E501", "T20", "E", "PL"]

View file

@ -24,7 +24,6 @@ class DataType:
return self._decode(decoder) return self._decode(decoder)
def encode_to_buffer(self, value): def encode_to_buffer(self, value):
print(type(value))
encoder = BinaryPayloadBuilder(byteorder=Endian.BIG, wordorder=Endian.BIG) encoder = BinaryPayloadBuilder(byteorder=Endian.BIG, wordorder=Endian.BIG)
self._add(encoder, value) self._add(encoder, value)
return encoder.build() return encoder.build()
@ -91,7 +90,8 @@ class registerReadError(Exception):
# Constructor parameters: # Constructor parameters:
# address: address as specified in the spreadsheet # address: address as specified in the spreadsheet
# datatype: One of the above datatypes, as specified for the address in the spreadsheet # datatype: One of the above datatypes, as specified for the address in the spreadsheet
# unit: the modbus unit, either '1' for the fronius inverter or 200 for the attached fronius smart meter. # unit: the modbus unit, either '1' for the fronius inverter or 200 for the attached fronius
# smart meter.
# description: free text to describe the register's purpose # description: free text to describe the register's purpose
class FroniusReg: class FroniusReg:
def __init__(self, address, datatype, unit, description): def __init__(self, address, datatype, unit, description):

View file

@ -1,8 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import unittest import unittest
import pyfroniusreg.froniusreg as froniusreg from pyfroniusreg import froniusreg
class TestDataTypes(unittest.TestCase): class TestDataTypes(unittest.TestCase):
def test_int16(self): def test_int16(self):