Skip to content

Commit 5b5267e

Browse files
committed
chore: add pre-commit
1 parent 03e3038 commit 5b5267e

16 files changed

+71
-8
lines changed

.codespell_ignore_words

Whitespace-only changes.

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
charset = utf-8
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[**.py]
13+
indent_style = space
14+
indent_size = 4
15+
16+
[**.js]
17+
indent_style = space
18+
indent_size = 4

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: CI
22
on:
33
push:
44
pull_request:
5-
# release:
6-
# types: [released]
5+
# release:
6+
# types: [released]
77
workflow_dispatch:
88

99
env:
@@ -50,7 +50,7 @@ jobs:
5050
strategy:
5151
fail-fast: false
5252
matrix:
53-
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
53+
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
5454
runs-on: ubuntu-latest
5555
steps:
5656
- uses: actions/checkout@v4
@@ -94,7 +94,7 @@ jobs:
9494
strategy:
9595
fail-fast: false
9696
matrix:
97-
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
97+
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
9898
runs-on: ubuntu-latest
9999
steps:
100100
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
default_language_version:
2+
python: python3.12
3+
exclude: ^(tests/const.py|tests/_files)
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v5.0.0
7+
hooks:
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- id: check-case-conflict
11+
- id: check-json
12+
- id: check-yaml
13+
- id: check-toml
14+
- id: check-merge-conflict
15+
- repo: https://github.com/asottile/pyupgrade
16+
rev: v3.20.0
17+
hooks:
18+
- id: pyupgrade
19+
args: ["--py39-plus"]
20+
- repo: https://github.com/astral-sh/ruff-pre-commit
21+
rev: v0.12.0
22+
hooks:
23+
- id: ruff-check
24+
args: ["--fix"]
25+
- id: ruff-format
26+
- repo: https://github.com/rbubley/mirrors-prettier
27+
rev: v3.6.0
28+
hooks:
29+
- id: prettier
30+
files: "\\.(js|json|css|less|md|yml|yaml)$"
31+
- repo: https://github.com/codespell-project/codespell
32+
rev: v2.4.1
33+
hooks:
34+
- id: codespell

.prettierrc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
printWidth: 90
2+
tabWidth: 4
3+
semi: true
4+
trailingComma: "none"
5+
singleQuote: false
6+
quoteProps: consistent
7+
bracketSpacing: false
8+
overrides:
9+
- files: ["*.yaml", "*.yml", "*.json", "*.less"]
10+
options:
11+
tabWidth: 2

gcode_thumbnail_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _potential_lines_from_gcode_file(path: str) -> str:
135135

136136
line_no = 0
137137
content_lines = []
138-
with open(path, "r", encoding="utf8", errors="ignore") as f:
138+
with open(path, encoding="utf8", errors="ignore") as f:
139139
line_no = 0
140140
for line in f:
141141
line_no += 1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ develop = [
2828
"pytest-doctest-custom>=1.0.0,<2",
2929
"pytest>=8.3.4,<9",
3030
"pre-commit",
31-
]
31+
]
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)