little bit of ci (#96)

* more pre-commit

* run in ci

* fix violations

* cleanup
This commit is contained in:
Adeeb Shihadeh
2022-10-22 18:07:59 -07:00
committed by GitHub
parent 8d5c58f05a
commit 18f4bd76c0
6 changed files with 51 additions and 7 deletions
+17
View File
@@ -0,0 +1,17 @@
name: tests
on:
push:
pull_request:
jobs:
precommit:
name: pre-commit
runs-on: ubuntu-20.04
timeout-minutes: 8
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- run: 'pip install pre-commit'
- run: 'pre-commit run --all'
+29 -2
View File
@@ -1,11 +1,38 @@
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: check-ast
exclude: tools
exclude: '^(tools)/'
- id: check-json
- id: check-xml
- id: check-yaml
- id: check-merge-conflict
- id: check-symlinks
- id: check-added-large-files
args: ['--maxkb=100']
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
exclude: '^(userspace/files/serviceproviders.xml)|(tools/)'
args:
# if you've got a short variable name that's getting flagged, add it here
- -L bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup
- --builtins clear,rare,informal,usage,code,names,en-GB_to_en-US
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
exclude: '^(tools/)'
additional_dependencies: ['flake8-no-implicit-concat']
args:
- --indent-size=2
- --enable-extensions=NIC
- --select=F,E112,E113,E304,E502,E701,E702,E703,E71,E72,E731,W191,W6
- --statistics
- -j4
+1 -1
View File
@@ -129,7 +129,7 @@ echo "" >> /etc/apt/sources.list
echo "deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted" >> /etc/apt/sources.list
echo "deb http://ports.ubuntu.com/ubuntu-ports/ bionic universe" >> /etc/apt/sources.list
# Install neccesary libs
# Install necessary libs
apt-get update -yq
apt-get install --no-install-recommends -yq \
libacl1:armhf \
+1 -1
View File
@@ -2,7 +2,7 @@
echo "Installing openpilot dependencies"
# Install neccesary libs
# Install necessary libs
apt-get update
apt-get install --no-install-recommends -yq \
autoconf \
+2 -2
View File
@@ -15,7 +15,7 @@ INA231_MASK_REG = 0x06
INA231_LIMIT_REG = 0x07
INA231_MASK_CONFIG = (1 << 12) # Bus undervoltage, not latching
INA231_BUS_VOLTAGE_LSB_mV = 1.25
VOLTAGE_FILE = f"/sys/class/hwmon/hwmon1/in1_input"
VOLTAGE_FILE = "/sys/class/hwmon/hwmon1/in1_input"
PARAM_FILE = "/data/params/d/LastPowerDropDetected"
alert_pin_base = f"/sys/class/gpio/gpio{POWER_ALERT_GPIO_PIN}/"
@@ -118,6 +118,6 @@ if __name__ == '__main__':
state_last = f.read().strip()
if int(state_last) == 0:
perform_controlled_shutdown()
except:
except Exception:
pass
+1 -1
View File
@@ -18,7 +18,7 @@ echo -n "/firmware/image" > /sys/module/firmware_class/parameters/path
count=0
while [ ! -s /firmware/image/adsp.mdt ]; do
sleep 0.1
# wait 10s for /firmare mounted
# wait 10s for /firmware mounted
count=$(( $count + 1 ))
if [ $count -ge 100 ]; then
echo "[ERROR] Can not find the adsp's firmware"