Skip to content

Commit 92f022b

Browse files
committed
Update lint.yml to use ruff
Use ruff GitHub Action from https://github.com/chartboost/ruff-action
1 parent c4f171c commit 92f022b

File tree

1 file changed

+8
-34
lines changed

1 file changed

+8
-34
lines changed

.github/workflows/lint.yml

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,11 @@ on:
1717
- 'docs/**'
1818

1919
jobs:
20-
build:
21-
22-
runs-on: ubuntu-20.04
23-
strategy:
24-
matrix:
25-
python-version: [3.8]
26-
27-
steps:
28-
- uses: actions/checkout@v2
29-
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v4
31-
with:
32-
python-version: ${{ matrix.python-version }}
33-
- name: Check Code Format with Black
34-
uses: psf/black@stable
35-
with:
36-
options: "--check --verbose --line-length=79"
37-
src: "./pythainlp"
38-
version: "~= 22.0"
39-
- name: Install dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
43-
pip install "h5py>=2.10.0,<3" "tensorflow>=2.3.1,<3"
44-
pip install torch==1.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
45-
pip install deepcut
46-
pip install .[full]
47-
pip install flake8 flake8-commas flake8-comprehensions flake8-tidy-imports
48-
- name: Lint with flake8
49-
run: |
50-
# stop the build if there are Python syntax errors or undefined names
51-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
52-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
53-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
20+
ruff:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: chartboost/ruff-action@v1
25+
with:
26+
src: "./pythainlp"
27+
args: --check --verbose --line-length 79 --select F --select E7 --select E9 --select E63 --select E82 --select C901

0 commit comments

Comments
 (0)