Skip to content

Commit

Permalink
Make some changes to black code
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlett-k-nhs committed Mar 13, 2024
1 parent efeb060 commit cd795ca
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/python-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,37 @@

name: Python Setup

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: [push, pull_request]

env:
BLACK_VERSION: 23.12.1
PYTHON_VERSION: 3.11
PYTHON_VERSION: 3.11.6

permissions:
contents: read

jobs:
black-format:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
options: "--check --verbose"
src: "./src"
version: ${{env.BLACK_VERSION}}
python-version: ${{env.PYTHON_VERSION}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python${{env.PYTHON_VERSION}} -m pip install -r requirements.txt
- name: Install Linting Dependences
run: |
python${{env.PYTHON_VERSION}} -m pip install black==${{env.BLACK_VERSION}}
python${{env.PYTHON_VERSION}} -m pip install flake8
- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src --max-line-length=127
black --check *.py

0 comments on commit cd795ca

Please sign in to comment.