Skip to content

debugged isort problem - fast quiet edit and push #3

debugged isort problem - fast quiet edit and push

debugged isort problem - fast quiet edit and push #3

Workflow file for this run

name: Pre-Commit Linting
on:
push:
branches: ['**'] # Runs on all branches when pushing
pull_request:
branches: ['**'] # Runs on all PRs
types: [opened, synchronize]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history for better diffs
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install pre-commit and dependencies
run: |
pip install pre-commit black==25.1.0 isort==6.0.1 flake8==7.1.2
- name: Run pre-commit hooks
run: |
# Run pre-commit and capture the output
OUTPUT=$(pre-commit run --all-files) || true
# Check if any files were modified
if [[ $OUTPUT == *"Fixing"* ]]; then
echo "::warning::Pre-commit would make changes to some files. Please run pre-commit locally and commit the changes."
echo "$OUTPUT"
# Don't fail the workflow, just warn
else
echo "No files need formatting changes."
fi