Skip to content

Commit d55cf57

Browse files
authored
Add pre-commit config (#34)
1 parent 1699452 commit d55cf57

File tree

9 files changed

+155
-16
lines changed

9 files changed

+155
-16
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ on:
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
14-
14+
1515
steps:
1616
- uses: actions/checkout@v4
17-
17+
1818
- name: Install uv
1919
uses: astral-sh/setup-uv@v4
20-
20+
2121
- name: Set up Python
2222
run: uv python install
23-
23+
2424
- name: Install dependencies
2525
run: |
2626
uv sync --dev
2727
cd 01-hello && uv run pywrangler dev --help
28-
28+
2929
- name: Run tests
3030
run: uv run pytest -vv

.github/workflows/semgrep.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
pull_request: {}
33
workflow_dispatch: {}
4-
push:
4+
push:
55
branches:
66
- main
77
- master
@@ -22,5 +22,3 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
- run: semgrep ci
25-
26-

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: "v5.0.0"
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-symlinks
9+
- id: check-yaml
10+
exclude: .clang-format
11+
- id: debug-statements
12+
- id: end-of-file-fixer
13+
- id: mixed-line-ending
14+
- id: trailing-whitespace
15+
- id: requirements-txt-fixer
16+
17+
- repo: https://github.com/codespell-project/codespell
18+
rev: "v2.3.0"
19+
hooks:
20+
- id: codespell
21+
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.7.4
24+
hooks:
25+
- id: ruff
26+
name: ruff check
27+
args: [--fix]
28+
- id: ruff-format
29+
name: ruff format

03-fastapi/wrangler.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ compatibility_date = "2025-08-14"
55

66
[vars]
77
MESSAGE = "My env var"
8-

04-query-d1/db_init.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
CREATE TABLE IF NOT EXISTS qtable (
2-
id INTEGER PRIMARY KEY AUTOINCREMENT,
3-
quote TEXT,
1+
CREATE TABLE IF NOT EXISTS qtable (
2+
id INTEGER PRIMARY KEY AUTOINCREMENT,
3+
quote TEXT,
44
author Text
55
);
66

7-
INSERT INTO qtable (quote, author)
7+
INSERT INTO qtable (quote, author)
88
SELECT * FROM (
9-
VALUES
9+
VALUES
1010
("This is a very cool quote", "Hood Chatham"),
1111
("Some words of wisdom", "Dominik Picheta"),
1212
("The sense 'fragment of verbal expression', attested from the 17th century", "Wikipedia")

05-langchain/.dev.vars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
API_KEY=abc123
1+
API_KEY=abc123

06-assets/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ https://docs.astral.sh/uv/getting-started/installation/#standalone-installer
1212
Now, if you run `uv run pywrangler dev` within this directory, it should use the config
1313
in `wrangler.toml` to run the example.
1414

15-
You can also run `uv run pywrangler deploy` to deploy the example.
15+
You can also run `uv run pywrangler deploy` to deploy the example.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies = []
88

99
[dependency-groups]
1010
dev = [
11+
"pre-commit>=4.3.0",
1112
"pytest>=8.4.1",
1213
"requests>=2.32.5",
1314
"ruff>=0.12.10",

uv.lock

Lines changed: 112 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)