Skip to content

Commit

Permalink
[REF] pylint_odoo: Use check-name instead of check-code for add_messa…
Browse files Browse the repository at this point in the history
…ge method (#174)

When a check is found the method `add_message` is called with the number of the check `W7904` instead of the name of the check `deprecated-openerp-xml-node`

This change is necessary to used the new configuration `odoo_check_versions` like this:

```python
    odoo_check_versions = {                                                     
        'useless-attribute-non-translatable': {                                 
            'min_odoo_version': '8.0',                                          
        },                                                                                                                                                                                             
   } 
```

Without this change the `odoo_check_versions` should be like this:

```python
    odoo_check_versions = {                                                     
        'W7904': {                                 
            'min_odoo_version': '8.0',                                          
        },                                                                                                                                                                                             
   } 
```

It keep more readable `odoo_check_versions`
  • Loading branch information
Jesus Zapata authored and moylop260 committed Dec 4, 2017
1 parent 6280a09 commit b9016b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pylint_odoo/misc.py
Expand Up @@ -173,7 +173,7 @@ def _check_{NAME_KEY}(self, module_path)
node_lineno_original = node.lineno
msg_args_extra = self.set_extra_file(node, msg_args,
msg_code)
self.add_message(msg_code, line=node.lineno, node=node,
self.add_message(name_key, line=node.lineno, node=node,
args=msg_args_extra)
node.file = node_file_original
node.lineno = node_lineno_original
Expand Down

0 comments on commit b9016b0

Please sign in to comment.