From 57fa5a766f593f5be14f56314fb3b971b8a774ad Mon Sep 17 00:00:00 2001 From: "Moises Lopez - https://www.vauxoo.com/" Date: Sat, 26 Nov 2016 07:18:58 -0600 Subject: [PATCH] [REF] attribute-deprecated: Deprecate length class attribute (#86) * [REF] attribute-deprecated: Deprecate length class attribute Related issue: https://github.com/OCA/maintainer-quality-tools/issues/385 and https://github.com/odoo/odoo/issues/13780 * [REF] .travis.yml: Disable F999 Disable the error: "dictionary key 'name' repeated with different value" This error is duplicated from pylint. --- .travis.yml | 2 +- pylint_odoo/checkers/no_modules.py | 2 +- pylint_odoo/test/main.py | 2 +- pylint_odoo/test_repo/broken_module/models/broken_model.py | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1967f507..1501bf7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ install: - pip install tox script: - - flake8 --exclude=__init__.py . + - flake8 --ignore=F999 --exclude=__init__.py . - tox -e $TOXENV,profile-stats after_success: diff --git a/pylint_odoo/checkers/no_modules.py b/pylint_odoo/checkers/no_modules.py index 88a97344..ad133047 100644 --- a/pylint_odoo/checkers/no_modules.py +++ b/pylint_odoo/checkers/no_modules.py @@ -196,7 +196,7 @@ 'Other OSI approved licence', 'Other proprietary', ] DFTL_ATTRIBUTE_DEPRECATED = [ - '_columns', '_defaults', + '_columns', '_defaults', 'length', ] DFTL_METHOD_REQUIRED_SUPER = [ 'create', 'write', 'read', 'unlink', 'copy', diff --git a/pylint_odoo/test/main.py b/pylint_odoo/test/main.py index 7b971486..acfa9dfe 100644 --- a/pylint_odoo/test/main.py +++ b/pylint_odoo/test/main.py @@ -12,7 +12,7 @@ EXPECTED_ERRORS = { 'api-one-deprecated': 4, 'api-one-multi-together': 2, - 'attribute-deprecated': 2, + 'attribute-deprecated': 3, 'class-camelcase': 1, 'consider-merging-classes-inherited': 2, 'copy-wo-api-one': 2, diff --git a/pylint_odoo/test_repo/broken_module/models/broken_model.py b/pylint_odoo/test_repo/broken_module/models/broken_model.py index 9760ca48..bf2c10ae 100644 --- a/pylint_odoo/test_repo/broken_module/models/broken_model.py +++ b/pylint_odoo/test_repo/broken_module/models/broken_model.py @@ -20,6 +20,7 @@ class TestModel(models.Model): _columns = {} # deprecated columns _defaults = {} # deprecated defaults + length = fields.Integer() # Deprecated length by js errors name = fields.Char( _(u"Näme"), # Don't need translate