acb73101c0
- Consolidated and simplified code formatting by removing unnecessary line breaks and improving readability in various functions. - Updated the handling of backup file sending in backup.py for better clarity. - Streamlined error handling and logging messages in several handlers to enhance consistency. - Adjusted the Makefile to exclude specific files during Ruff checks and formatting. - Made minor adjustments to function signatures and parameter handling for improved clarity and consistency. This commit enhances code maintainability and readability without altering functionality.
35 lines
993 B
YAML
35 lines
993 B
YAML
name: Code Formatting
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install ruff
|
|
|
|
- name: Run Ruff formatter with pyproject.toml
|
|
run: ruff format . --config pyproject.toml --exclude main.py,handlers/payments
|
|
|
|
- name: Check for changes
|
|
id: check_changes
|
|
run: |
|
|
git diff --exit-code || echo "changes_detected=true" >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit and push changes
|
|
if: steps.check_changes.outputs.changes_detected == 'true'
|
|
run: |
|
|
git config --global user.name 'GitHub Actions'
|
|
git config --global user.email 'actions@github.com'
|
|
git add .
|
|
git commit -m "Auto-format code with Ruff using pyproject.toml"
|
|
git push |