File tree Expand file tree Collapse file tree 2 files changed +22
-22
lines changed Expand file tree Collapse file tree 2 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,25 @@ jobs:
20
20
uses : actions/setup-python@v1
21
21
with :
22
22
python-version : 3.9
23
+
23
24
- name : Install dependencies
24
25
run : |
25
26
python -m pip install --upgrade pip
26
- python -m pip install --upgrade pipenv==2022.10.4
27
- pipenv install --dev --system --skip-lock
28
- - name : Lint with flake8
29
- run : |
30
- pipenv run flake8
31
- - name : Lint with black
32
- run : |
33
- pipenv run black .
27
+ python -m pip install --upgrade pipenv==2022.10.4 pre-commit
28
+ pipenv install --system --skip-lock
29
+
30
+ - uses : actions/cache@v3
31
+ with :
32
+ path : ~/.cache/pre-commit
33
+ key : pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
34
+
35
+ - name : Install pre-commit hooks
36
+ run : pre-commit install --install-hooks
37
+
38
+ - name : Run pre-commit checks
39
+ run : pre-commit run --show-diff-on-failure --all-files
40
+ env :
41
+ GITGUARDIAN_API_KEY : ${{ secrets.GITGUARDIAN_API_KEY }}
34
42
35
43
build :
36
44
runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change @@ -5,24 +5,16 @@ SHELL :=/bin/bash
5
5
test ?= tests
6
6
7
7
all :
8
- echo " Usage :"
9
- echo " make test" # Run tests
10
- echo " make coverage" # Run tests and coverage
11
- echo " make black" # Run black formatter on python code
12
- echo " make flake8" # Run flake8 linter on python code
13
- echo " make isort" # Run isort linter on python code
8
+ echo " Targets:"
9
+ echo " test Run tests"
10
+ echo " coverage Run tests with coverage"
11
+ echo " lint Run all linters"
14
12
15
13
test :
16
14
pipenv run pytest --disable-pytest-warnings -vvv $(test )
17
15
18
16
coverage :
19
17
pipenv run coverage run --source pygitguardian -m pytest --disable-pytest-warnings && pipenv run coverage report --fail-under=80
20
18
21
- black :
22
- pipenv run black .
23
-
24
- flake8 :
25
- pipenv run flake8
26
-
27
- isort :
28
- pipenv run isort ** /* .py
19
+ lint :
20
+ pre-commit run --all
You can’t perform that action at this time.
0 commit comments