Skip to content

Adding new results and logic in the repo #271

Adding new results and logic in the repo

Adding new results and logic in the repo #271

# .github/workflows/lint_and_format.yaml
name: Code Quality Checks
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
types: [opened, synchronize, reopened]
jobs:
run-pre-commit:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
# Add this to ensure pip's bin directory is in PATH
# It's usually the default, but explicitly setting can help
cache-dependency-path: requirements.txt # If you use requirements.txt
# For Linux runners, the executable should be in ~/.local/bin or similar.
# setup-python typically adds this to PATH, but being explicit helps debug.
- name: Upgrade pip and install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Verify pre-commit installation
run: |
which pre-commit # This command shows the full path to the executable
pre-commit --version # This confirms it's found and runnable
- name: Set up git authentication for pre-commit
run: |
git config --global url."https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Run pre-commit hooks
run: pre-commit run --all-files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}