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
Pylint: enable unused-variable check #121
Conversation
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.
Please find one minor comment inline.
| @@ -368,7 +369,8 @@ def test_2_automountmap_add_duplicate(self): | |||
| """ | |||
| Test adding a duplicate direct map. | |||
| """ | |||
| res = api.Command['automountmap_add_indirect'](self.locname, self.mapname, **self.direct_kw)['result'] | |||
| api.Command['automountmap_add_indirect']( | |||
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.
You may want to keep the test for 'result' in the output with:
assert 'result' in api.Command...
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.
In this case assert is not needed because test is expecting DuplicateError to be raised. So assert is useless there.
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.
Agree with your comment.
|
I disagree, I really think that there should not be assert |
|
Agree with you, ACK. |
| @@ -1225,7 +1226,6 @@ def __lt__(self, other): | |||
|
|
|||
| def _cmp_sequence(self, pattern, self_start, pat_len): | |||
| self_idx = self_start | |||
| self_len = len(self) | |||
| pat_idx = 0 | |||
| # and self_idx < self_len | |||
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.
Remove this comment as it would be even more confusing then than it is now.
| @@ -188,7 +188,7 @@ def test_remove_the_only_connection(self): | |||
| returncode, error = tasks.destroy_segment(self.master, "%s-to-%s" % replicas) | |||
| assert returncode != 0, error1 | |||
| assert error.count(text) == 1, error2 % error | |||
| newseg, err = tasks.create_segment(self.master, | |||
| _newseg, err = tasks.create_segment(self.master, | |||
| self.master, | |||
| self.replicas[1]) | |||
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.
You may want to add indentation here.
|
The changes seem fine except for the two small nitpicks. |
This commit removes unused variables or rename variables as "expected to be unused" by using "_" prefix. This covers only cases where fix was easy or only one unused variable was in a module
This commit removes or marks unused variables as "expected to be unused" by using '_' prefix.
Unused variables may: * make code less readable * create dead code * potentialy hide issues/errors Enabled check should prevent to leave unused variable in code Check is locally disabled for modules that fix is not clear or easy or have too many occurences of unused variables
|
The latest changes fixed the nitpicks mentioned, ACK. Thanks 👍 |
Modules with too many unused variables have check locally disabled