Skip to content

Commit bf349a4

Browse files
committed
🧰 chore(ci): switch to GitHub Actions and add lint hooks
1 parent 6ef989e commit bf349a4

5 files changed

Lines changed: 60 additions & 11 deletions

File tree

‎.flake8‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
max-line-length = 120
3+
max-complexity = 12
4+
select = E,F,W,C90
5+
extend-ignore = F403,F405
6+
exclude =
7+
.git,
8+
__pycache__,
9+
venv,
10+
build,
11+
dist,
12+
sdiff.egg-info

‎.github/workflows/ci.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
push:
8+
branches: [master]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
cache: "pip"
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install .[tests]
26+
27+
- name: Lint
28+
run: python -m flake8 --config .flake8 sdiff tests
29+
30+
- name: Test
31+
run: python -m coverage run -m pytest -s --durations=3 --durations-min=0.005
32+
33+
- name: Coverage report
34+
run: python -m coverage report -m

‎.husky/pre-commit‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
python -m flake8 --config .flake8 sdiff tests

‎.travis.yml‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎package.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "html-structure-diff",
3+
"private": true,
4+
"devDependencies": {
5+
"husky": "^9.0.0"
6+
},
7+
"scripts": {
8+
"prepare": "husky install"
9+
}
10+
}

0 commit comments

Comments
 (0)