Merge pull request #161 from freelawproject/pre-commit-ci-update-config #532
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2-beta | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.8" | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
- name: Activate venv | |
run: | | |
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV | |
echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH | |
- name: Black Code Formatter | |
uses: psf/black@stable | |
- name: isort Import Sorter | |
uses: isort/[email protected] | |
- name: pylint Error Checker | |
run: pylint -E -f colorized xray | |
- name: mypy Static Type Checker | |
run: mypy . | |
- name: Flynt f-string Formatter | |
run: > | |
flynt . | |
--line-length=79 | |
--transform-concats | |
--fail-on-change |