HomePhabricator

Add python3 script shebang lint

Description

Add python3 script shebang lint

Summary:
Backport of core PR12972
https://github.com/bitcoin/bitcoin/pull/12972/files

This converts the test-security.py script to python3 and add a linter
to enforce python3 shebang.

Core ignores python files with no shebang. I prefer to add them to the
files missing it (with the exception of the __init__.py files).

Depends on D3927.

Test Plan:
Should return no error:

arc lint --everything

Edit contrib/devtools/test-security.py to remove the shebang.
Check the linter throw an error.

Add a shebang with /usr/bin/env python or /usr/bin/env python2.
Check the linter throw an error.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3928

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Apr 13 2018, 15:37
FabienCommitted on Aug 23 2019, 06:26
FabienPushed on Aug 23 2019, 06:26
Reviewer
Restricted Project
Differential Revision
D3928: Add python3 script shebang lint
Parents
rABC1dba6721b352: Remove the ZMQ example for Python 2
Branches
Unknown
Tags
Unknown