Skip to content

[ECO-1295] Add pre-commit python script harness and custom check to verify file naming #60

[ECO-1295] Add pre-commit python script harness and custom check to verify file naming

[ECO-1295] Add pre-commit python script harness and custom check to verify file naming #60

Workflow file for this run

# cspell:words snok, virtualenvs, pydeps, venv, Pylint, pylint
---
env:
POETRY_VERSION: '1.5.1'
PYTHON_VERSION: '3.8'
jobs:
pre-commit:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/setup-python@v3'
with:
python-version: '${{ env.PYTHON_VERSION }}'
- name: 'Cache Poetry Install'
uses: 'actions/cache@v3'
with:
key: 'poetry-${{ env.POETRY_VERSION }}'
path: '${{ runner.home }}/.local'
- name: 'Install Poetry'
uses: 'snok/[email protected]'
with:
installer-parallel: true
version: '${{ env.POETRY_VERSION }}'
virtualenvs-create: true
virtualenvs-in-project: true
- id: 'cache-deps'
name: 'Cache Dependencies'
uses: 'actions/cache@v3'
with:
key: |
pydeps-${{ hashFiles('**/poetry.lock') }}
path: '.venv'
- if: |
steps.cache-deps.outputs.cache-hit != 'true'
name: 'Install Dependencies'
# `--no-root` to install all dependencies but not the project itself.
run: 'poetry install --no-interaction --no-root'
- name: 'Install Poetry Project'
run: 'poetry install --no-interaction'
- uses: 'pre-commit/[email protected]'
with:
extra_args: '--all-files --config cfg/pre-commit-config.yaml --verbose'
# - name: 'Format With Black'
# run: |
# black 'src'
# - name: 'Lint With Pylint'
# run: |
# pylint --fail-under=7.0 --recursive=y --enable=W 'src'
name: 'pre-commit'
'on':
pull_request: null
workflow_dispatch: null
...