qlib icon indicating copy to clipboard operation
qlib copied to clipboard

auto lint fix in CI

Open donaldkuck opened this issue 1 month ago • 0 comments

🌟 Feature Description

Could we add a CI job for automated lint fixing?

Motivation

This would enable automatic lint checking and fixing within our CI pipeline, saving manual effort and freeing up developers' time.

sample code:

name: Lint Fix

on:
  pull_request:
    branches:
      - main

jobs:

  lint-fix:
    name: Fix linting issues
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write

    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.head_ref }}
          repository: ${{ github.event.pull_request.head.repo.full_name }}
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }}

... ...

      - name: run format
        run:
          make format
      # Commit and push changes if any
      - name: Check for changes
        id: git-check
        run: |
          git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT
      - name: Commit and push if there are changes
        if: steps.git-check.outputs.changes == 'true'
        run: |
          git config --local user.email "XXX"
          git config --local user.name "XXX"
          git commit -a -m "🤖 Auto-fix linting issues"
          git push

donaldkuck avatar Nov 24 '25 08:11 donaldkuck