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 d371e9e
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 34 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

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 pylint pyright pytest-md
- 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 .
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
- name: Analysing typing with pyright
run: |
pyright --version ${{ matrix.python-version }}
- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
verbose: true
emoji: false
job-summary: true
custom-arguments: "-q"
click-to-expand: true
report-title: "Test Report"
26 changes: 0 additions & 26 deletions .github/workflows/pylint.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .todo
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
☐ pydoc?
https://docs.python.org/3/library/pydoc.html
GitHub workflows:
use github actions for pytest
use github actions for pytest @done(23-11-15 09:43)
https://blog.dennisokeeffe.com/blog/2021-08-08-pytest-with-github-actions
github action for pyright
github action for black, flake8, isort
github action for pyright @done(23-11-15 09:43)
github action for black, flake8, isort @done(23-11-15 09:43)


App:
Expand Down Expand Up @@ -58,7 +58,8 @@

Other:
DevOps:
☐ review .pylintc file
☐ review .pylinrc file
☐ attempt at parallelizing some workflows.

Tests:
yfinance:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Pylint](https://github.com/joce/stockyard/actions/workflows/pylint.yml/badge.svg)](https://github.com/joce/stockyard/actions/workflows/pylint.yml)
[![CI](https://github.com/joce/stockyard/actions/workflows/ci.yml/badge.svg)](https://github.com/joce/stockyard/actions/workflows/ci.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 d371e9e

Please sign in to comment.