Skip to content

Commit

Permalink
Make style checker use proper list for args
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kk7ds committed Oct 3, 2023
1 parent b564721 commit ffd2e63
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
10 changes: 9 additions & 1 deletion tools/cpep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tools/fast-driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
26 changes: 16 additions & 10 deletions tools/py3_driver_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ffd2e63

Please sign in to comment.