The Puppet repository contains both Python2 and Python3 files, both with and without .py extension (see T144169).
The CI runs tox to lint them, but at the moment flake8 is run with Python2 and lints all the files with Python2 flake8, failing on Py3 files.
We should find a solution that allows to properly lint each file according to its shebang (when present) or something else (a specially crafted comment?) when the shebang is not present (or enforce all files to have a shebang).
We could use the approach suggested when discussing about T144169, to have CI pass the list of modified files to a custom script that will select those that are Python (by extension, shebang and other detection ways) and have it properly lint them with the right Python2/3 version accordingly.
Thoughts?