Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/pr_audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This is the name of the workflow
name: PR Audit

# It will run whenever a Pull Request is opened
on: [pull_request]

# This defines the set of steps to run
jobs:
lint:
# Use a VM running Ubuntu
runs-on: ubuntu-latest

# All the steps to do the job

steps:
# Step1: Download the code from pull request
- name: Check code
uses: actions/checkout@v4
# Step2: Set up Python(v3.11) in VM
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
# Step3: Install the necessary tools to check the code
- name: Install tools
run: |
pip install flake8 black isort reviewdog

# Step4: Linting with flake8 and commenting with reviewdog
- name: Run flake8 for linting
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
reporter: github-pr-review
level: warning
fail_on_error: true
filter_mode: diff_context
# Step5: Check if the code is formatted using black
- name: Run Black
run: black . --check
#Step6: Check if imports are sorted correctly using isort
- name: Run isort
run: isort . --check-only


Loading