Skip to content

Commit

Permalink
run pre commit in ci (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm authored May 29, 2020
1 parent 2ade6ee commit 0430bfa
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
set -e
docker build -t opendbc .
name: "Build"
- name: Static analysis
run: |
docker run opendbc bash -c "cd opendbc && git init && git add -A && pre-commit run --all"
- run: |
docker run opendbc bash -c "python -m unittest discover opendbc"
name: "Unit tests"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.mypy_cache/
*.pyc
*.os
*.tmp
Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN pyenv rehash

COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt
RUN pip install pre-commit==2.4.0 pylint==2.5.2

ENV PYTHONPATH=/project

Expand All @@ -20,4 +21,5 @@ RUN git clone https://github.com/commaai/cereal.git /project/cereal
COPY SConstruct .
COPY . /project/opendbc

RUN rm -rf /project/opendbc/.git
RUN scons -c && scons -j$(nproc)

0 comments on commit 0430bfa

Please sign in to comment.