Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[codespell]
skip = *.csv, *.json
ignore-words-list = selectin
ignore-words-list = selectin
26 changes: 26 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pre-commit

on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
activate-environment: true

- name: Install the project
run: uv sync --locked --all-extras --dev

- name: Run pre-commit
run: uv run pre-commit run --all-files
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: [--config=.codespellrc]

- repo: local
hooks:
- id: whitelist-check
name: Check whitelist is empty
entry: python3
language: system
args: [-c, "exec(open('pcweb/whitelist.py').read()); assert not WHITELISTED_PAGES, f'WHITELISTED_PAGES includes {WHITELISTED_PAGES}'"]
files: ^pcweb/whitelist\.py$
10 changes: 5 additions & 5 deletions pcweb/components/icons/lucide/data/icon-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@
"diy",
"fixed",
"build",
"contruction",
"construction",
"parts"
],
"bomb": [
Expand Down Expand Up @@ -1733,7 +1733,7 @@
"informed",
"knowledge",
"knowledgeable",
"knowledgable",
"knowledgeable",
"education",
"high school",
"university",
Expand Down Expand Up @@ -6285,7 +6285,7 @@
"helmet",
"construction",
"safety",
"savety"
"safety"
],
"hash": [
"hashtag",
Expand Down Expand Up @@ -10608,7 +10608,7 @@
"shield-minus": [
"unshield",
"cybersecurity",
"unsecure",
"insecure",
"unguard",
"unblock",
"antivirus",
Expand Down Expand Up @@ -13535,4 +13535,4 @@
"magnifying glass",
"plus"
]
}
}
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ dependencies = [
]

[dependency-groups]
dev = ["pytest", "playwright", "pytest-playwright", "uvicorn"]
dev = ["pytest", "playwright", "pytest-playwright", "uvicorn", "pre-commit"]

[tool.setuptools.packages.find]
where = ["pcweb"]

[tool.ruff]
target-version = "py311"
output-format = "concise"
lint.isort.split-on-trailing-comma = false
lint.select = [
"ANN001",
Expand Down
Loading
Loading