Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge 1e69c8c into b558350
Browse files Browse the repository at this point in the history
  • Loading branch information
moylop260 committed Aug 20, 2015
2 parents b558350 + 1e69c8c commit d4f7ef9
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -31,7 +31,7 @@ env:
- INCLUDE="test_module,second_module" UNIT_TEST="1"
- VERSION="7.0" INCLUDE="test_module,second_module" ODOO_REPO="OCA/OCB" # ODOO_REPO usage example
- VERSION="6.1" INCLUDE="test_module,second_module"
- LINT_CHECK="1" TESTS="0"
- LINT_CHECK="1" TESTS="0" PYLINT_EXPECTED_ERRORS="17"

install:
- cp -r ../maintainer-quality-tools/ $HOME
Expand Down
1 change: 1 addition & 0 deletions tests/test_repo/broken_module/I0013.py
@@ -0,0 +1 @@
# pylint: skip-file
1 change: 1 addition & 0 deletions tests/test_repo/broken_module/ipdb.py
@@ -0,0 +1 @@
# W0402(deprecated-module) require module present
66 changes: 65 additions & 1 deletion tests/test_repo/broken_module/model.py
@@ -1,8 +1,72 @@

from openerp.osv import orm, fields

import os
import os as os2 # W0404 - duplicated import

import __openerp__ # W0403 - relative import

# w0402 - deprecated module
import pdb # pylint: disable=W0403
import pudb # pylint: disable=W0403
import ipdb # pylint: disable=W0403

class TestModel(orm.Model):

class test_model(orm.Model):
_name = "test.model"
_columns = {
'name': fields.char('Title', 100),
}

def method_test(self, arg1, arg2):
return None

def method_e1124(self):
value = self.method_test(
'arg_param1', arg1='arg_param1')
return value

def method_e1306(self):
return "%s %s" % ('value1')

def method_e1601(self):
print "Hello world!"

def method_w0101(self):
return True
return False

def method_w0102(self, arg1, arg2=[]):
# avoid imported but unused
all_imports = (
os, os2, __openerp__, pdb, pudb, ipdb)
return all_imports

def method_w0104_w0105(self):
2*6*0
"str any effect"

def method_w0109(self):
my_duplicated_key_dict = {
'key1': 'value1',
'key2': 'value2',
'key1': 'value3',
}
return my_duplicated_key_dict

def method_w1401(self):
my_regex_str_bad = '\d'
my_regex_str_good = r'\d'
return my_regex_str_bad, my_regex_str_good


if __name__ == '__main__':

def method_w1111():
return None

VAR1 = method_w1111()

class E0101(object):
def __init__(self):
return 'E0101'
1 change: 1 addition & 0 deletions tests/test_repo/broken_module/pdb.py
@@ -0,0 +1 @@
# W0402(deprecated-module) require module present
1 change: 1 addition & 0 deletions tests/test_repo/broken_module/pudb.py
@@ -0,0 +1 @@
# W0402(deprecated-module) require module present
16 changes: 14 additions & 2 deletions travis/test_pylint
Expand Up @@ -14,7 +14,19 @@ pylint_rcfile = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'cfg',
"travis_run_pylint.cfg")
result = run_pylint.main([
count_errors = run_pylint.main([
"--config-file=" + pylint_rcfile,
], standalone_mode=False)
exit(result)

expected_errors = int(
os.environ.get('PYLINT_EXPECTED_ERRORS', 0))

exit_status = 0
if count_errors != expected_errors:
print("pylint expected errors {expected_errors}, "
"found {number_errors}!".format(
expected_errors=expected_errors,
number_errors=count_errors))
exit_status = 1

exit(exit_status)

0 comments on commit d4f7ef9

Please sign in to comment.