OCA / pylint-odoo

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

incoherent-interpreter-exec-perm (W8201) doesn't recognize shebang #265

Closed guewen closed 4 years ago

guewen commented 4 years ago

pylint-odoo reports this:

stock_vertical_lift_kardex/proxy/kardex-proxy.py:1: [W8201(incoherent-interpreter-exec-perm), ] You have a python file with execution permissions but you don't have a interpreter magic comment. If you really needs a execution permission then add a magic comment ( https://en.wikipedia.org/wiki/Shebang_(Unix) ). If you don't needs a execution permission then remove it with: chmod -x kardex-proxy.py

(ref https://travis-ci.org/OCA/stock-logistics-warehouse/jobs/626622668#L285)

The file:

(ref https://github.com/OCA/stock-logistics-warehouse/blob/f49b1031e44594a8da6cce0912e6a74b29498d27/stock_vertical_lift_kardex/proxy/kardex-proxy.py#L1-L6)

So no warning should be raised.

moylop260 commented 4 years ago

Hi @guewen Thanks for reporting the issue

I just download your branch

git remote add oca https://github.com/OCA/stock-logistics-warehouse
git fetch -p oca +refs/pull/*/head:refs/pull/oca/*
git checkout pull/oca/797

I ran the following command: python3.7 -m pylint -d all -e incoherent-interpreter-exec-perm stock_vertical_lift_kardex/proxy/kardex-proxy.py And the output is reproduced.

I just ran the following command: chmod +x stock_vertical_lift_kardex/proxy/kardex-proxy.py

And the issue was fixed.

I just have attached the following screenshot:

I have created the following PR in order to fix it:

Regards!

guewen commented 4 years ago

:flushed: I'm sorry, I should have thought about this. Thanks a lot for your help and for even creating a PR!

I opened #266 to mention that the warning can trigger for a file without +x but with a magic comment (although I'm not sure will keep it cf. https://github.com/OCA/maintainer-quality-tools/issues/623#issuecomment-567065945)

moylop260 commented 4 years ago

Thanks for PR We need think what is the better way to deprecate pylint checks duplicated since that we decided using pre-commit

I just opened the following issue: https://github.com/OCA/pylint-odoo/issues/267