Run formatting checks with poetry (#537)
* update black version * add workflow dispatch
This commit is contained in:
20
.github/workflows/black_format.yml
vendored
20
.github/workflows/black_format.yml
vendored
@@ -4,6 +4,7 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.py'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
black-check:
|
||||
@@ -13,15 +14,24 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.10.10
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install Black
|
||||
run: pip install black
|
||||
- name: Install poetry
|
||||
run: pip install poetry
|
||||
|
||||
- name: Set Poetry config
|
||||
run: |
|
||||
poetry config virtualenvs.in-project false
|
||||
poetry config virtualenvs.path ~/.virtualenvs
|
||||
|
||||
- name: Install dependencies using Poetry
|
||||
run: |
|
||||
poetry install -E dev
|
||||
|
||||
- name: Run Black
|
||||
run: black --check . -l 140
|
||||
run: poetry run black --check . -l 140
|
||||
|
||||
# (Optional) If you want to automatically fix formatting issues
|
||||
# Uncomment the following steps:
|
||||
|
||||
Reference in New Issue
Block a user