Black Formatting & Pylint Linting #35
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
# GitHub Action for performing Black Formatting and Pylint Linting | |
# Author: Andrew Jarombek | |
# Date: 10/8/2022 | |
name: Black Formatting & Pylint Linting | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
- cron: "0 5 * * 5" | |
workflow_dispatch: | |
jobs: | |
linting_formatting: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- run: echo "Job running on a ${{ runner.os }} server" | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Black formatting dry run | |
uses: psf/black@stable | |
with: | |
options: "--check" | |
src: "./api/src" | |
- name: Install Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install Pylint & Pipenv | |
run: | | |
pip install --upgrade pip | |
pip install pylint==2.15.9 | |
pip install pipenv==2022.12.19 | |
- name: Analyzing the Code with Pylint | |
working-directory: ./api/src | |
run: | | |
pipenv install --ignore-pipfile --system | |
pylint $(git ls-files '*.py') |