11 Commits

Author SHA1 Message Date
Gorka Eguileor
15d8ad15d2 pylint: Fix migration E1120 no-value-for-parameter
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
2021-04-16 13:05:21 +02:00
Gorka Eguileor
d2d5e92503 pylint: Fix E1120 no-value-for-parameter for mocks
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
2021-04-16 13:04:58 +02:00
Eric Harney
aa13e3b3c3 Pylint: Filter out cinder.objects and requests E1101
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
2019-02-21 13:28:44 -05:00
Zuul
70f331228a Merge "Get rid of keys() usage" 2018-10-10 13:01:06 +00:00
Chuck Short
68c8038434 Fix pylint warning
Multiple isinstance calls can be merged into one for better
readability.

Change-Id: Ib1a5c3e28acad1f9f13b981612422d9c4c2b4986
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-09-26 21:37:25 -04:00
Chuck Short
348b7a9f7d Remove unecessary pass
Remove unecessary "pass" where they are not needed.

Change-Id: I200a3c0e40720cd53694ae157861d62dee42ab1f
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-09-25 15:12:50 -04:00
Chuck Short
37ffab3e22 Get rid of keys() usage
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>
2018-09-21 11:07:07 -04:00
Zuul
d79cb53718 Merge "Fix pylint warnings for "unnecessary not"" 2018-09-20 19:40:54 +00:00
Chuck Short
39defc040b Clean up bare raised pylint warning
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>
2018-09-10 17:44:21 -04:00
Chuck Short
7c50366f49 Fix pylint warnings for "unnecessary not"
Fix boolean expressions that creates an unnecessary negation.

Change-Id: Ib17693a426107949488b920a19fa3d13398ee897
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-09-10 15:12:18 -04:00
Chuck Short
adcfb4f97e Simplify running pylint
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>
2018-09-06 10:00:07 -04:00