main.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: PyLint
  2. on:
  3. push:
  4. branches: [ master ]
  5. workflow_dispatch:
  6. jobs:
  7. PEP8:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. - name: Setup Python
  12. uses: actions/setup-python@v1
  13. with:
  14. python-version: 3.9
  15. - name: Install Python lint libraries
  16. run: |
  17. pip3 install autoflake isort black
  18. - name: Remove unused imports and variables
  19. run: |
  20. autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports .
  21. - name: lint with isort
  22. run: |
  23. isort .
  24. - name: lint with black
  25. run: |
  26. black .
  27. # commit changes
  28. - uses: stefanzweifel/git-auto-commit-action@v4
  29. with:
  30. commit_message: '[AUTO] Code-Format'
  31. commit_options: '--no-verify'
  32. repository: .
  33. commit_user_name: TheHamkerCat
  34. commit_user_email: thehamkercat@gmail.com
  35. commit_author: TheHamkerCat <thehamkercat@gmail.com>