Vauxoo / pylint-odoo

1 stars 4 forks source link

[IMP] pylint_odoo: Check if the string parameter is equal to variable nam #97

Closed JesusZapata closed 7 years ago

JesusZapata commented 7 years ago

Check if the name of the variable is equal to string parameter

Tested cases

name_equal_to_string = fields.Float("Name equal to string") # Show warning many_2_one = fields.Many2one('res.users', "Many 2 one") # Show warning many_2_many = fields.Many2many('res.users', 'relation', 'fk_column_from', 'fk_column_to', "Many 2 many") # Show warning

Referent to issue https://github.com/Vauxoo/pylint-odoo/issues/92

moylop260 commented 7 years ago

Could you run this check with a big project...? For example addons-vauxoo and add a print screen here please

JesusZapata commented 7 years ago

Comand run

PYTHONPATH=/root/build/Vauxoo/pylint-odoo pylint -d all -e attribute-string-redundant --load-plugins=pylint_odoo /root/build/Vauxoo/addons-vauxoo/

Output

************* Module addons-vauxoo.stock_card.model.stock_card
W:426,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:434,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.account_voucher_tax_sat.model.account_voucher_tax_sat
W: 37,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.product_do_merge.wizard.base_product_merge
W: 61,12: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 72,19: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 74,17: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.aging_due_report.wizard.wizard
W: 56,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 57,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 56,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 57,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 58,10: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 59,12: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 60,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:139,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:152,12: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:154,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:157,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:163,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:166,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:169,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:172,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:175,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:220,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:226,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:229,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:232,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:235,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:238,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:262,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:290,16: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.hr_timesheet_reports.model.hr_timesheet_reports
W:358,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.test_sale_team_warehouse.models.test_model
W: 17,16: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 32,16: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.partner_foreign.model.res_partner
W: 91,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.website_rate_product.models.mail_message
W: 30,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 66,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.purchase_order_line_sequence.model.purchase
W: 54,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.account_refund_early_payment.wizard.refund_early_payments
W: 76,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)

------------------------------------------------------------------
Your code has been rated at 9.98/10 (previous run: 9.98/10, +0.00)
moylop260 commented 7 years ago

Please, create a new pr to oca with this sha 5c40212