Skip to content

Commit 73f3144

Browse files
committed
🧰 chore: enforce autopep8 checks and clean setup
1 parent 32f9a77 commit 73f3144

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
python -m pip install --upgrade pip
2525
python -m pip install .[tests]
2626
27+
- name: Format check
28+
run: python -m autopep8 --exit-code --diff --max-line-length 120 -r sdiff tests
29+
2730
- name: Lint
2831
run: python -m flake8 --config .flake8 sdiff tests
2932

‎.husky/pre-commit‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4+
python -m autopep8 --exit-code --diff --max-line-length 120 -r sdiff tests
45
python -m flake8 --config .flake8 sdiff tests

‎AGENTS.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ The core library lives in `sdiff/` (parser, comparer, renderer, and models). Tes
88
- `make dev` installs the package plus test/dev extras (`.[tests,devtools]`) into the venv.
99
- `make test` runs linting and the full pytest suite with coverage.
1010
- `make vtest` runs pytest verbosely.
11-
- `make flake` runs flake8 on `sdiff/` and `tests/`.
11+
- `make flake` runs the autopep8 format check and flake8 on `sdiff/` and `tests/`.
12+
- `make format` applies autopep8 formatting to `sdiff/` and `tests/`.
1213
- `make cov` prints the coverage report.
1314
- `make clean` removes build artifacts and the venv.
15+
- `make hooks` installs Husky git hooks (requires Node/npm; `make dev` runs this).
1416

1517
Example flow:
1618
```sh

‎Makefile‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919

2020
dev: env update
2121
$(PIP) install .[tests,devtools]
22+
@$(MAKE) hooks
2223

2324
install: env update
2425

@@ -28,8 +29,20 @@ publish:
2829
$(TWINE) upload --verbose --sign --username developer --repository-url http://$(PYPICLOUD_HOST)/simple/ dist/*.whl
2930

3031
flake:
32+
$(PYTHON) -m autopep8 --exit-code --diff --max-line-length 120 -r sdiff tests
3133
$(FLAKE) sdiff tests
3234

35+
format:
36+
$(PYTHON) -m autopep8 --in-place --max-line-length 120 -r sdiff tests
37+
38+
hooks:
39+
@if command -v npm >/dev/null 2>&1; then \
40+
npm install --no-package-lock --silent; \
41+
npm run --silent prepare; \
42+
else \
43+
echo "npm not found; skipping husky install"; \
44+
fi
45+
3346
test: flake
3447
$(COVERAGE) run -m pytest $(TEST_RUNNER_FLAGS)
3548

@@ -57,4 +70,4 @@ clean:
5770
rm -rf venv
5871

5972

60-
.PHONY: all build env linux run pep test vtest testloop cov clean
73+
.PHONY: all build env linux run pep test vtest testloop cov clean hooks format

‎setup.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def read(f):
4141
package_data={},
4242
namespace_packages=[],
4343
install_requires=install_requires,
44-
tests_require=tests_require,
4544
extras_require={
4645
'tests': tests_require,
4746
'devtools': devtools_require,

0 commit comments

Comments
 (0)