run pre commit in ci (#268)
This commit is contained in:
parent
2ade6eeba8
commit
0430bfa5c2
|
@ -12,6 +12,9 @@ jobs:
|
||||||
set -e
|
set -e
|
||||||
docker build -t opendbc .
|
docker build -t opendbc .
|
||||||
name: "Build"
|
name: "Build"
|
||||||
|
- name: Static analysis
|
||||||
|
run: |
|
||||||
|
docker run opendbc bash -c "cd opendbc && git init && git add -A && pre-commit run --all"
|
||||||
- run: |
|
- run: |
|
||||||
docker run opendbc bash -c "python -m unittest discover opendbc"
|
docker run opendbc bash -c "python -m unittest discover opendbc"
|
||||||
name: "Unit tests"
|
name: "Unit tests"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
.mypy_cache/
|
||||||
*.pyc
|
*.pyc
|
||||||
*.os
|
*.os
|
||||||
*.tmp
|
*.tmp
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: master
|
||||||
|
hooks:
|
||||||
|
- id: check-ast
|
||||||
|
- id: check-json
|
||||||
|
- id: check-xml
|
||||||
|
- id: check-yaml
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
|
rev: master
|
||||||
|
hooks:
|
||||||
|
- id: mypy
|
||||||
|
- repo: https://github.com/PyCQA/flake8
|
||||||
|
rev: master
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
||||||
|
args:
|
||||||
|
- --select=F
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: pylint
|
||||||
|
name: pylint
|
||||||
|
entry: pylint
|
||||||
|
language: system
|
||||||
|
types: [python]
|
||||||
|
args:
|
||||||
|
- --disable=R,C,W
|
|
@ -10,6 +10,7 @@ RUN pyenv rehash
|
||||||
|
|
||||||
COPY requirements.txt /tmp/
|
COPY requirements.txt /tmp/
|
||||||
RUN pip install -r /tmp/requirements.txt
|
RUN pip install -r /tmp/requirements.txt
|
||||||
|
RUN pip install pre-commit==2.4.0 pylint==2.5.2
|
||||||
|
|
||||||
ENV PYTHONPATH=/project
|
ENV PYTHONPATH=/project
|
||||||
|
|
||||||
|
@ -20,4 +21,5 @@ RUN git clone https://github.com/commaai/cereal.git /project/cereal
|
||||||
COPY SConstruct .
|
COPY SConstruct .
|
||||||
COPY . /project/opendbc
|
COPY . /project/opendbc
|
||||||
|
|
||||||
|
RUN rm -rf /project/opendbc/.git
|
||||||
RUN scons -c && scons -j$(nproc)
|
RUN scons -c && scons -j$(nproc)
|
||||||
|
|
Loading…
Reference in New Issue