forked from OCA/pylint-odoo
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [REF] invalid-name, unused-argument: Suppress check for migrations path (OCA#348) The following path: - module/x.y.z/migrations/pre-migration.py has a few false negatives Considering that standard method is: def migrate(cr, version): - invalid-name (C0103) for module and argument name - e.g. "pre-migration.py" instead of pre_migration.py - e.g. "cr" for cursor - unused-argument (W0613) for argument - e.g. "version" for version of Odoo They are valid since that Odoo has already defined as it So supressing from augmentations Fix OCA#338 * [ADD] context-overridden: Better using kwargs instead of dictionary (OCA#256) More info about see docstring of the method: - https://github.com/odoo/odoo/blob/ff3064258a320e4008b3fb52a149e6751ae1e7f5/odoo/models.py#L5086-L5105 Using - `self.with_context({'key': 'value'})` The original context is overridden It should be: - `self.with_context(**{'key': 'value'})` - `self.with_context(key='value')` If you need to override the full context only silent this check using: - `self.with_context({'key': 'value'}) # pylint: disable=context-overridden` In order to allow an explicit overridden * [ADD] dangerous-qweb-replace-wo-priority: Consider qweb view templates (OCA#347) More info about: - https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#inherited-xml Fix OCA#323 * [REF] README: Auto-update Using pylint_odoo.messages2rst() * [REF] requirements: Upgrade pylint version (OCA#349) Add compatibility for pylint between 2.6 and 2.9 The method `_is_in_ignore_list_re` changed for each version * [FIX] sql-injection: AttributeError: 'NoneType' object has no attribute 'parent' (OCA#350) Using the following code: queries = [ "SELECT id FROM res_partner", "SELECT id FROM res_users", ] for query in queries: self.env.cr.execute(query) The check sql-injection shows the following error: - AttributeError: 'NoneType' object has no attribute 'parent' So, Now it is validating if it is not None * [REF] sql-injection: No sql-injection using constants (OCA#351) The following examples should not be considered as sql-injection: self.env.cr.execute("SELECT * FROM %s" % 'table_constant') self.env.cr.execute("SELECT * FROM {}".format('table_constant')) self.env.cr.execute("SELECT * FROM %(table_variable)s" % {'table_variable': 'table_constant'}) Since that the constant is not possible to inject * [FIX] sql-injection: AttributeError: 'NoneType' object has no attribute 'parent' Using the following code: queries = [ "SELECT id FROM res_partner", "SELECT id FROM res_users", ] for query in queries: self.env.cr.execute(query) The check sql-injection shows the following error: - AttributeError: 'NoneType' object has no attribute 'parent' So, Now it is validating if it is not None * [FIX] sql-injection: Fix false positive using BinOp "+" Considering the following valid case: cr.execute('SELECT ' + operator + ' FROM table' + 'WHERE') The representation tree is: node.repr_tree() BinOp( op='+', left=BinOp( op='+', left=BinOp( op='+', left=Const(value='SELECT '), right=Name(name='operator')), right=Const(value=' FROM table')), right=Const(value='WHERE')) Notice that left node is another BinOp node So, it need to be considered recursively * [REF] manifest-version-format: Add new valid odoo v15.0 (OCA#353) * [REF] requirements: Upgrade pylint version 2.11.1 (OCA#354) * [REF] .travis.yml: Fix syntax error
- Loading branch information
Showing
12 changed files
with
244 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.