Add ruff linter to pre-deploy #5
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
# This workflow will install Python dependencies, run tests and lint | |
name: pre-deploy (linters and tests) | |
on: | |
# run only when finance/ folder is changed | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
paths: | |
- 'finance/**' | |
jobs: | |
pylint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
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 pylint | |
- name: Analysing the code with pylint | |
# if score is less than 1, the build will fail | |
run: | | |
pylint $(git ls-files '*.py') --fail-under=1 | |
black: | |
name: check code style with black | |
uses: ahnazary/actions-library/.github/workflows/black.yaml@main | |
isort: | |
name: check code style with isort | |
uses: ahnazary/actions-library/.github/workflows/isort.yaml@main | |
ruff: | |
name: check code style with ruff | |
uses: ahnazary/actions-library/.github/workflows/ruff.yaml@main |