Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Virashu committed Jul 25, 2024
1 parent 93fc19c commit 0a8a829
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 52 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Linting

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4

- 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
pip install -r requirements.txt
black:
steps:
- name: Install black
run: |
pip install black
- name: Format the code with black
run: |
black $(git ls-files '*.py')
pyright:
steps:
- name: Install pyright
run: |
pip install basedpyright
- name: Analyze the code with pyright
run: |
basedpyright $(git ls-files '*.py') --outputjson | jq '.summary.errorCount' > pyright_errors.txt
pylint:
steps:
- name: Install pylint
run: |
pip install pylint
- name: Analyze the code with pylint
run: |
pylint -f json2 $(git ls-files '*.py') | jq '.statistics.score' > pylint_score.txt
# - name: Archive artifacts
# uses: actions/upload-artifact@v4
# with:
# name: Upload pylint.json
# path: |
# pylint.json
finally:
steps:
- name: Combine results
run: |
echo "{ \"pyright_errors\": $(cat pyright_errors.txt), \"pylint_score\": $(cat pylint_score.txt) }" > lint.json
- name: Release nightly
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: nightly
tag_name: nightly
files: lint.json
fail_on_unmatched_files: true
30 changes: 0 additions & 30 deletions .github/workflows/pylint.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/pyright.yml

This file was deleted.

8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ build-backend = "poetry.core.masonry.api"

[tool.pylint]
disable = ["missing-module-docstring", "missing-class-docstring", "missing-function-docstring"]

[tool.pyright]
typeCheckingMode = "strict"
analyzeUnannotatedFunctions = true
reportImplicitOverride = true
reportDeprecated = true
reportAny = false

0 comments on commit 0a8a829

Please sign in to comment.