Skip to content

Commit

Permalink
Add new workflow to check for coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
joce committed Nov 15, 2023
1 parent 9db56d0 commit 5423083
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Pylint

on:
push:
branches:
- master

workflow_run:
workflows: ["Coding Standards"]
branches: [master]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/standards_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Coding Standards

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt isort black flake8
- name: Checking imports with isort
# change to python 3.12 when isort supports it
run: |
isort -c --profile black --python-version 3 .
- name: Checking formatting with black
run: |
black --check --target-version py312 .
- name: Checking style with flake8
run: |
flake8 .
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Pylint](https://github.com/joce/stockyard/actions/workflows/pylint.yml/badge.svg)](https://github.com/joce/stockyard/actions/workflows/pylint.yml)
[![Standards](https://github.com/joce/stockyard/actions/workflows/standards_check.yml/badge.svg)](https://github.com/joce/stockyard/actions/workflows/standards_check.yml)

# stockyard

Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
black >= 23.10
pylint >= 3.0
pyright >= 1.1.335
pylint >= 3.0 # not required
pyright >= 1.1.335 # not required
pytest >= 7.4
requests >= 2.31
textual >= 0.40
Expand Down

0 comments on commit 5423083

Please sign in to comment.