Add a basic pre-commit config

Also fix some things it cleaned up in default config.
This commit is contained in:
Dan Smith 2023-10-02 17:02:17 -07:00 committed by Dan Smith
parent ffd2e63e23
commit 68f6a46f5c
10 changed files with 64 additions and 46 deletions

23
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
exclude_types:
- binary
exclude: \.img$
- id: end-of-file-fixer
exclude_types:
- binary
exclude: \.img$
- id: check-yaml
- repo: local
hooks:
- id: pep8
verbose: true
name: pep8
entry: env PATH=.tox/style/bin python tools/cpep8.py
files: \.py$
language: python

View File

@ -49,4 +49,3 @@ Note: This will not uninstall directories created by the installation of
Chirp. Presence of these empty directories shouldn't be a problem, but
if they are, it's easy to go through the files.txt file, identify them,
and remove them.

View File

@ -60,5 +60,3 @@ Exceptions that have been observed in testing formats which are
invalid in this context are caught, and the default format is used.
========

View File

@ -465,21 +465,22 @@ For the purposes of the Python 3 effort, a "tested" radio means
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
`MemoryMapBytes` exclusively internally. Whenever possible, all radios
that are fixed for py3 should do so with this flag set to False and with
the byte-native memory map.

View File

@ -32,4 +32,3 @@ serialsniff: serialsniff.c
clean:
$(REMOVE) serialsniff *~ *.o *.bak core tags shar a.out

View File

@ -92,4 +92,3 @@ for usbserial in /sys/class/tty/ttyUSB*; do
break
fi
done

View File

@ -208,8 +208,7 @@ def main():
`NEEDS_COMPAT_SERIAL = False` flag on the radio class, and thus uses
`MemoryMapBytes` exclusively internally. Whenever possible, all radios
that are fixed for py3 should do so with this flag set to False and with
the byte-native memory map.
"""),
the byte-native memory map."""),
file=output)
for driver, (tester, tested) in testers.items():