Skip to content

Commit fae4a74

Browse files
committed
Add pre-commit
1 parent 494a0da commit fae4a74

19 files changed

+451
-403
lines changed

.circleci/config.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: 2.1
22

33
build_and_test: &build_and_test_steps
44
- checkout
5-
# Do not use `sudo pip`
65
# pipx is already installed, but `pipx list` is empty
76
- run: python --version ; pip --version ; pipx --version ; pwd ; ls -l
87
- run: pip install pytest -r requirements.txt
@@ -11,18 +10,14 @@ build_and_test: &build_and_test_steps
1110

1211

1312
jobs:
14-
StyleCheck:
13+
pre-commit:
1514
docker:
1615
- image: cimg/python:3.14
1716
steps:
1817
- checkout
19-
- run: python --version ; pip --version ; pipx --version ; pwd ; ls -l
20-
- run: pipx run codespell -L queenland,uint,assertin
21-
- run: pipx run ruff check
22-
- run: pipx run black . --check
18+
- run: pipx run pre-commit run --all-files --show-diff-on-failure
2319

24-
25-
Python3:
20+
pytest:
2621
docker:
2722
- image: cimg/python:3.14
2823
steps: *build_and_test_steps
@@ -31,5 +26,5 @@ jobs:
3126
workflows:
3227
build:
3328
jobs:
34-
- StyleCheck
35-
- Python3
29+
- pre-commit
30+
- pytest

.pre-commit-config.yaml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,70 @@
11
# Learn more about this config here: https://pre-commit.com/
22

3-
# To enable these pre-commit hooks, run:
3+
# To enable these pre-commit hooks run:
44
# `pipx install pre-commit` or `brew install pre-commit`
5-
# Then, in the project root directory, run `pre-commit install`
5+
# Then in the project root directory run `pre-commit install`
66

77
repos:
88
- repo: https://github.com/pre-commit/pre-commit-hooks
99
rev: v6.0.0
1010
hooks:
1111
- id: check-added-large-files
12+
- id: check-ast
13+
# - id: check-builtin-literals
14+
- id: check-case-conflict
15+
- id: check-docstring-first
16+
exclude: "test_s2gs/test_all.py$"
17+
# - id: check-executables-have-shebangs
18+
- id: check-json
19+
- id: check-merge-conflict
20+
- id: check-shebang-scripts-are-executable
21+
- id: check-symlinks
22+
- id: check-toml
23+
- id: check-vcs-permalinks
24+
- id: check-xml
25+
- id: check-yaml
26+
- id: debug-statements
27+
- id: destroyed-symlinks
28+
- id: detect-private-key
29+
- id: end-of-file-fixer
30+
- id: file-contents-sorter
31+
- id: fix-byte-order-marker
32+
- id: forbid-new-submodules
33+
- id: forbid-submodules
34+
#- id: mixed-line-ending
35+
# args:
36+
# - --fix=lf
37+
#- id: name-tests-test
38+
#- id: pretty-format-json
39+
# exclude: fe/jsconfig.json
40+
- id: requirements-txt-fixer
41+
- id: sort-simple-yaml
42+
- id: trailing-whitespace
43+
44+
- repo: https://github.com/MarcoGorelli/auto-walrus
45+
rev: 0.3.4
46+
hooks:
47+
- id: auto-walrus
48+
49+
- repo: https://github.com/codespell-project/codespell
50+
rev: v2.4.1
51+
hooks:
52+
- id: codespell # See pyproject.toml for args
53+
additional_dependencies:
54+
- tomli
55+
56+
- repo: https://github.com/astral-sh/ruff-pre-commit
57+
rev: v0.13.2
58+
hooks:
59+
- id: ruff-check
60+
# - id: ruff-format
61+
62+
- repo: https://github.com/tox-dev/pyproject-fmt
63+
rev: v2.6.0
64+
hooks:
65+
- id: pyproject-fmt
66+
67+
- repo: https://github.com/abravalheri/validate-pyproject
68+
rev: v0.24.1
69+
hooks:
70+
- id: validate-pyproject

CHANGELOG.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,3 @@ Changed Stuff (non-backwards compatible!):
214214
* is_build flag marking abilities that create units
215215
* build_unit indicating the unit type that is built
216216
* build_time indicating the build time for the ability
217-

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,3 @@ and kept this project going.
326326
.. _phpsc2replay: http://code.google.com/p/phpsc2replay/
327327
.. _sc2replay-csharp: https://github.com/ascendedguard/sc2replay-csharp
328328
.. _s2protocol: https://github.com/Blizzard/s2protocol
329-

docs/source/articles/addingnewdatapacks.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Adding new Datapacks
33
=======================
44

5-
TODO
5+
TODO

docs/source/dataobjects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Build
2525
--------------------------
2626

2727
.. autoclass:: Build
28-
:members:
28+
:members:

docs/source/events/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ All of the gamplay and state information contained in the replay is packed into
1313
game
1414
message
1515
tracker
16-

docs/source/factories.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ DoubleCachedSC2Factory
2929
--------------------------
3030

3131
.. autoclass:: DoubleCachedSC2Factory
32-
:members:
32+
:members:

docs/source/mainobjects.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ Game Summary
2323

2424
.. autoclass:: GameSummary
2525
:members:
26-

docs/source/sc2reader.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
SC2Reader
44
======================
55

6-
The replay factory
6+
The replay factory

0 commit comments

Comments
 (0)