You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

autofix.yml 921B

1234567891011121314151617181920212223242526272829303132
  1. name: autofix.ci
  2. on:
  3. workflow_call:
  4. pull_request:
  5. push:
  6. branches: [ "main" ]
  7. permissions:
  8. contents: read
  9. jobs:
  10. autofix:
  11. if: github.repository == 'langgenius/dify'
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v4
  15. # Use uv to ensure we have the same ruff version in CI and locally.
  16. - uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f
  17. - run: |
  18. cd api
  19. uv sync --dev
  20. # Fix lint errors
  21. uv run ruff check --fix-only .
  22. # Format code
  23. uv run ruff format .
  24. - name: ast-grep
  25. run: |
  26. uvx --from ast-grep-cli sg --pattern 'db.session.query($WHATEVER).filter($HERE)' --rewrite 'db.session.query($WHATEVER).where($HERE)' -l py --update-all
  27. - name: mdformat
  28. run: |
  29. uvx mdformat .
  30. - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27