-
-
Notifications
You must be signed in to change notification settings - Fork 21
Ruff linting #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruff linting #79
Conversation
| discovery_enabled : bool = False | ||
| json : bool = False | ||
| reconnect_delay : int = 7 | ||
| ''' seconds ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classes/transports/modbus_base.py
Outdated
| if not self.protocolSettings.validate_registry_entry(entry, current_value): | ||
| raise ValueError("Invalid value in register. unsafe to write") #i need to figure out a better error handler for theese. | ||
|
|
||
| # if not self.protocolSettings.validate_registry_entry(entry, current_value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would like to keep this in.
adding a transport setting to handle disabling this would be the "proper" way todo it.
validating the "current value" is important for detecting the accuracy of the register definitions. ie, making sure your not writting to the wrong reigster.
maybe a
allow_unsafe_writes = True
setting could be added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops. That was my hack to get writing to work in that other issue. I'll revert.
|
|
||
| size = len(packet) | ||
| crc = computeCRC(packet) | ||
| crc2 = calculate_crc(packet,size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. i'm not sure if i completed the pace transport. i think it's still a work in progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll put this back then, but comment it out.
|
looks good. ty for contributing. |

This is a work-in-progress branch to slowly add some common code standards using Ruff. As to not make one massive branch, this PR only fixes pycodingstyle rules, and basic code-error checks from pyflakes. You can see these rules in effect inside ruff.toml.
Checking is simple:
ruff checkto check the entire codebase.Over time, more rules can be added. Inside ruff.toml, commented out, you can see the ruleset/ignores I typically use in my projects.