Skip to content

Commit ee9be2b

Browse files
committed
Add pre-commit config
1 parent 42cf9c3 commit ee9be2b

File tree

9 files changed

+143
-16
lines changed

9 files changed

+143
-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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
name: check no trailing whitespace
7+
- id: end-of-file-fixer
8+
name: check files end in newline
9+
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.7.4
12+
hooks:
13+
- id: ruff
14+
name: ruff check
15+
args: [--fix]
16+
- id: ruff-format
17+
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

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",

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_04_query_d1(init_db, dev_server):
7070
"Hood Chatham",
7171
]
7272

73+
7374
@pytest.mark.xfail(reason="Not working")
7475
def test_05_langchain(dev_server):
7576
pass
76-

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)