Pylint raises E1120 on all many of our migrations because the insert
call is missing the dml parameter:
cinder/db/sqlalchemy/migrate_repo/versions/123_cinder_init.py:870:9:
E1120: No value for argument 'dml' in method call
(no-value-for-parameter)
The dml parameter is automatically added by sqlalchemy using a
decorator, like this:
@util.dependencies("sqlalchemy.sql.dml")
def insert(self, dml, values=None, inline=False, **kwargs):
This patch adds the decorator to the pyling configured
signature-mutators to remove these errors from incorrectly showing.
Change-Id: Icbc72b3655f379c9b97134e68a425dc1d623dc7b
Currently pylint is returning E1120 errors such as
No value for argument 'mock_clean' in method call
(no-value-for-parameter)
These are not correct and are cause by the mock decorator modifying the
parameters received by the method, as mentioned in
https://github.com/PyCQA/pylint/issues/259
This patch adds the configuration option signature-mutators to pylint
telling it that patch and patch.object mutate the method signatures.
Change-Id: Iac8cd96c87b7d812a937ba7d978034c37fc2eedd
Use generated-members to filter out false positives.
Unfortunately, generated-members doesn't really work
right, but this is close enough for now.
Change-Id: I184c3c98a90428dbb033da42d8938e8af9866b78
Multiple isinstance calls can be merged into one for better
readability.
Change-Id: Ib1a5c3e28acad1f9f13b981612422d9c4c2b4986
Signed-off-by: Chuck Short <chucks@redhat.com>
Remove unecessary "pass" where they are not needed.
Change-Id: I200a3c0e40720cd53694ae157861d62dee42ab1f
Signed-off-by: Chuck Short <chucks@redhat.com>
for x in some_dict.keys() can be written as for x in some_dict
Change-Id: I9cdb3e6802fbf85fe49f3855ccc2a68ce5cc56c4
Signed-off-by: Chuck Short <chucks@redhat.com>
Clean up bare raises warning by linter, pylint
complains about raising an exception specified
and not in the context of an exception handler.
Added an exception.
Change-Id: I1d77c6ab9849510c45fdd99dd57b71bde9a57da6
Signed-off-by: Chuck Short <chucks@redhat.com>
Fix boolean expressions that creates an unnecessary negation.
Change-Id: Ib17693a426107949488b920a19fa3d13398ee897
Signed-off-by: Chuck Short <chucks@redhat.com>
This commit does several things:
- Setup and run pylint directly rather than running
through a script. This allows the user to see what is happening
while the user is running through pylint.
- Allow the user to either run pylint on a particular changeset,
or the entire cinder tree.
- Allow the user to run on a particular changeset. Using like
HEAD~1, etc.
- Since the pylint gate check I disabled the tests that were
reported by pylint. The thought here would be go through
the failures and correct them.
- Update pylint to 2.1.1.
- Removed old pylintrc.
Change-Id: I708c93843d991e8c0ac114b0b2d6ede373b96d0a
Signed-off-by: Chuck Short <chucks@redhat.com>