Skip to content

Commit

Permalink
ci: update github action to use pre-commit hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanyHe committed Jul 10, 2023
1 parent 5c795bf commit 9c5f258
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/geochemistrypy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
Expand Down Expand Up @@ -28,13 +25,17 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
python -m pip install pre-commit
if [ -f requirements/production.txt ]; then pip install -r requirements.txt; fi
- name: Run pre-commit hooks
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --ignore=F811,W605 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=200 --statistics
pre-commit run --all-files
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --ignore=F811,W605 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=20 --max-line-length=200 --statistics
# - name: Test with pytest
# run: |
# pytest

0 comments on commit 9c5f258

Please sign in to comment.