Make style checker use proper list for args

The style checker currently always applies new rules to files on the
argument list. This makes it use the same logic for those as "all
files" mode. Also fix some style issues in tools/ scripts.
This commit is contained in:
Dan Smith 2023-10-01 18:56:12 -07:00 committed by Dan Smith
parent b5647216d5
commit ffd2e63e23
3 changed files with 27 additions and 13 deletions

View File

@ -100,8 +100,16 @@ def get_exceptions(f):
if args.files:
old_files = cpep8_manifest
cpep8_manifest = []
flake8_manifest = args.files
flake8_manifest = []
for fn in args.files:
if not fn.startswith('./'):
fn = './' + fn
if fn in old_files:
cpep8_manifest.append(fn)
else:
flake8_manifest.append(fn)
# read the blacklisted source files
blacklist = file_to_lines(blacklist_filename)

View File

@ -28,8 +28,8 @@ def find_imports(of_modules):
driver_imports = []
for fn in glob.glob('chirp/drivers/*.py'):
with open(fn) as f:
lines = [l for l in f.readlines()
if 'import ' in l and 'drivers' in l]
lines = [ln for ln in f.readlines()
if 'import ' in ln and 'drivers' in ln]
imports = []
for line in lines:
imports.extend(parse_import_line(line))

View File

@ -22,10 +22,12 @@ def tester_link(text):
assert os.path.exists(os.path.join('chirp', 'drivers',
text[1:] + '.py'))
return ('[Probably works]('
'https://github.com/kk7ds/chirp/blob/py3/chirp/drivers/%s.py)' % (
'https://github.com/kk7ds/chirp'
'/blob/py3/chirp/drivers/%s.py)' % (
text[1:]))
elif text.startswith('#') and text[1:].isdigit():
return '[Reported working](https://chirp.danplanet.com/issues/%i)' % int(text[1:])
return ('[Reported working]'
'(https://chirp.danplanet.com/issues/%i)' % int(text[1:]))
else:
return text
@ -114,8 +116,10 @@ def main():
print('## Status', file=output)
print('| Driver | Tester | Tested | Byte Clean | "Market Share" |', file=output)
print('| ------ | ------ | ------ | ---------- | -------------- |', file=output)
print('| Driver | Tester | Tested | Byte Clean | "Market Share" |',
file=output)
print('| ------ | ------ | ------ | ---------- | -------------- |',
file=output)
drivers = sorted([ident for ident in directory.DRV_TO_RADIO])
drvstested = 0
@ -186,17 +190,19 @@ def main():
at least the following procedure was followed:
1. Download from the radio
1. Make some change to a memory
1. If the radio has settings support, make sure settings load and tweak one setting
1. If the radio has settings support, make sure settings load and tweak
one setting
1. Upload to the radio
1. Confirm that the changes stick and look correct, or at least are not a
regression from the master py2 branch.
The drivers are all passing the automated tests, but tests with real hardware
and serial ports is important, especially around bytes-vs-string safety.
The drivers are all passing the automated tests, but tests with real
hardware and serial ports is important, especially around bytes-vs-string
safety.
To update this document, add/edit entries in `tests/py3_driver_testers.txt` and
then run `tox -e makesupported`. Commit the result (including the changes to this `.md`
file) and submit a PR.
To update this document, add/edit entries in `tests/py3_driver_testers.txt`
and then run `tox -e makesupported`. Commit the result (including the
changes to this `.md` file) and submit a PR.
The "Byte Clean" flag refers to whether or not the radio has set the
`NEEDS_COMPAT_SERIAL = False` flag on the radio class, and thus uses