diff --git a/.github/workflows/geochemistrypy.yml b/.github/workflows/geochemistrypy.yml index a034fd10..7a486f1e 100644 --- a/.github/workflows/geochemistrypy.yml +++ b/.github/workflows/geochemistrypy.yml @@ -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: @@ -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