|
46 | 46 | # run: |
|
47 | 47 | # pytest
|
48 | 48 |
|
| 49 | + lint-python2-rocky8: |
| 50 | + runs-on: ubuntu-22.04 |
| 51 | + container: |
| 52 | + image: rockylinux/rockylinux:8 |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + - name: Set up Python 2.7 with DNF and link to default |
| 56 | + run: | |
| 57 | + sudo dnf install -y python2 python2-pip |
| 58 | + - name: Install dependencies |
| 59 | + run: | |
| 60 | + python2 -m pip install --upgrade pip |
| 61 | + pip2 install flake8 pytest |
| 62 | + if [ -f requirements.txt ]; then pip2 install -r requirements.txt; fi |
| 63 | + - name: Lint with flake8 |
| 64 | + run: | |
| 65 | + # TODO: fix unittest dir and remove from excludes |
| 66 | + # TODO: fix or migrate legacy grsfs-fuse dir and remove from excludes |
| 67 | + # TODO: should tests be included here - currently fail on py3-only FileNotFoundError, etc. |
| 68 | + # stop the build if there are Python syntax errors or undefined names |
| 69 | + flake8 . --exclude=tests,state,envhelp,fixture,output,unittest,grsfs-fuse,irclib.py,seafile-seahub_settings-template.py --count --select=E9,F63,F7,F82 --show-source --statistics |
| 70 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 71 | + flake8 . --exclude=tests,state,envhelp,fixture,output,unittest,grsfs-fuse,vm-proxy,irclib.py,seafile-seahub_settings-template.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 72 | + # NOTE: for interactive clean up one can use current ignores |
| 73 | + # E501 Ignore long lines, E402 imports below top, E722 bare except, |
| 74 | + # F401 unused imports, F502 explicit list in str expand, F841 unused var, |
| 75 | + # E721 compare type instead of isinstance, W293 blank line with space, |
| 76 | + # C901 too complex get |
| 77 | + #flake8 mig --exclude=unittest,grsfs-fuse,vm-proxy,irclib.py,seafile-seahub_settings-template.py --ignore=E501,E402,E722,F401,F502,E713,F841,C901 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 78 | + # TODO: prepare and enable pytest |
| 79 | + #- name: Test with pytest |
| 80 | + # run: | |
| 81 | + # pytest |
0 commit comments