OCA / pylint-odoo

Odoo plugin for Pylint
http://www.pylint.org
143 stars 168 forks source link

[FIX] Visit module: manage odoo subdirectories #275

Closed ThomasBinsfeld closed 4 years ago

ThomasBinsfeld commented 4 years ago

Better way to check whether a path is a path of a subdirectoy of a Odoo module. Before, '/a/b/cc/d' was considered as a subdirectoy of '/a/b/c' because '/a/b/c' in '/a/b/cc/d' == True.

Now:

os.path.commonprefix(["/a/b/c", "/a/b/cc/d"]) == "/a/b"  # not a subdirectory
os.path.commonprefix(["/a/b/c", "/a/b/c/d"]) == "/a/b/c"  # subdirectory