Skip to content

Commit 8fb5256

Browse files
committed
Add pre-commit
1 parent 33747e2 commit 8fb5256

19 files changed

+462
-404
lines changed

.circleci/config.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.0
1+
version: 2.1
22

33
build_and_test: &build_and_test_steps
44
- checkout
@@ -11,27 +11,21 @@ build_and_test: &build_and_test_steps
1111

1212

1313
jobs:
14-
StyleCheck:
14+
pre-commit:
1515
docker:
1616
- image: cimg/python:3.11
1717
steps:
1818
- checkout
19-
- run: python --version ; pip --version ; pwd ; ls -l
20-
- run: pip install black codespell ruff
21-
- run: codespell -L queenland,uint,assertin
22-
- run: ruff check
23-
- run: black . --check
19+
- run: pipx run pre-commit run --all-files --show-diff-on-failure
2420

25-
26-
Python3:
21+
pytest:
2722
docker:
28-
- image: cimg/python:3.11
23+
- image: cimg/python:3.13
2924
steps: *build_and_test_steps
3025

3126

3227
workflows:
33-
version: 2
3428
build:
3529
jobs:
36-
- StyleCheck
37-
- Python3
30+
- pre-commit
31+
- pytest

.pre-commit-config.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Learn more about this config here: https://pre-commit.com/
2+
3+
# To enable these pre-commit hooks run:
4+
# `pipx install pre-commit` or `brew install pre-commit`
5+
# Then in the project root directory run `pre-commit install`
6+
7+
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v6.0.0
10+
hooks:
11+
- 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
@@ -327,4 +327,3 @@ and kept this project going.
327327
.. _phpsc2replay: http://code.google.com/p/phpsc2replay/
328328
.. _sc2replay-csharp: https://github.com/ascendedguard/sc2replay-csharp
329329
.. _s2protocol: https://github.com/Blizzard/s2protocol
330-

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)