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
linting: declare methods without self-use static and annotate legitimate methods #264
linting: declare methods without self-use static and annotate legitimate methods #264
Conversation
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
======================================
Coverage 54.8% 54.8%
======================================
Files 106 106
Lines 6264 6264
======================================
Hits 3438 3438
Misses 2826 2826
Continue to review full report at Codecov.
|
labgrid/remote/client.py
Outdated
@@ -925,7 +925,7 @@ def create(): | |||
|
|||
def find_role_by_place(config, place): | |||
for role, role_config in config.items(): | |||
resources, _ = target_factory.normalize_config(role_config) | |||
resources, _ = target_factory.__class__.normalize_config(role_config) |
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.
The class should be unnecessary here. You can use staticmethods on instances as well.
tests/test_factory.py
Outdated
@@ -54,7 +54,7 @@ def test_convert_dict(self): | |||
BarPort: | |||
name: bar | |||
""") | |||
l = target_factory._convert_to_named_list(data) | |||
l = target_factory.__class__._convert_to_named_list(data) |
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.
This shouldn't be necessary here as well.
No "self" is used, so declare it static. Signed-off-by: Bastian Stender <bst@pengutronix.de>
No "self" is used so declare it static. Signed-off-by: Bastian Stender <bst@pengutronix.de>
No "self" is used so declare it static. Signed-off-by: Bastian Stender <bst@pengutronix.de>
…t() static No "self" is used so declare it static. Avoid importing TargetFactory and thereby legitimizing its use instead of using the global TargetFactory instance "target_factory". Signed-off-by: Bastian Stender <bst@pengutronix.de>
No "self" use is valid here as it is inherited by IMXUSBLoader. "self" is used there. Signed-off-by: Bastian Stender <bst@pengutronix.de>
No "self" is used so declare it static. Avoid importing TargetFactory and thereby legitimizing its use instead of using the global TargetFactory instance "target_factory". Signed-off-by: Bastian Stender <bst@pengutronix.de>
These methods are inherited by USBSerialPortExport. "self" is used there. Signed-off-by: Bastian Stender <bst@pengutronix.de>
2cf5992
to
884358c
Compare
Pushed changes:
|
Fixes this linting warning: