From 6db02fe3f4035544d739bcc7158a1f000e54b6e8 Mon Sep 17 00:00:00 2001 From: Yigtwxx Date: Thu, 6 Aug 2026 08:55:15 +0300 Subject: [PATCH 1/2] docs: point CONTRIBUTING at the tooling the repo actually uses The Code Quality section sends a new contributor to ./PRE_COMMIT.md, which is not in the repository, and then names Black and Prettier as the project's formatters. .pre-commit-config.yaml runs ruff, ruff-format and biome; neither Black nor Prettier is configured anywhere. Replaces the dead link with the install command and the config file itself, so the list of hooks cannot drift out of date again, and corrects the two formatter names. --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1998bd74e..02e5411f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -102,14 +102,14 @@ SurfSense consists of three main components: ### Code Quality & Pre-commit Hooks We use pre-commit hooks to maintain code quality, security, and consistency across the codebase. Before you start developing: -1. **Install and set up pre-commit hooks** - See our detailed [Pre-commit Guide](./PRE_COMMIT.md) -2. **Understand the automated checks** that will run on your code +1. **Install and set up pre-commit hooks** - `pip install pre-commit && pre-commit install` +2. **Understand the automated checks** that will run on your code - every hook is listed in [`.pre-commit-config.yaml`](./.pre-commit-config.yaml); run them all with `pre-commit run --all-files` 3. **Learn about bypassing hooks** when necessary (use sparingly!) ### Code Style - **Backend**: Follow Python PEP 8 style guidelines - **Frontend**: Use TypeScript and follow the existing code patterns -- **Formatting**: Use the project's configured formatters (Black for Python, Prettier for TypeScript) +- **Formatting**: Use the project's configured formatters (Ruff for Python, Biome for TypeScript) ### Commit Messages Use clear, descriptive commit messages: From 140ebfe465364db76661f1db0c2b13597b4f2191 Mon Sep 17 00:00:00 2001 From: Yigtwxx Date: Thu, 6 Aug 2026 09:11:37 +0300 Subject: [PATCH 2/2] style(web): sort imports in error-toast.ts to unblock Biome check The biome-check-web hook is declared with always_run: true and pass_filenames: false, so it checks all of surfsense_web on every run regardless of which files a change touches. One unsorted import in lib/error-toast.ts therefore fails Frontend Quality, and with it the Quality Gate aggregator, on every pull request against dev. Applies Biome's own safe fix and nothing else. --- surfsense_web/lib/error-toast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/surfsense_web/lib/error-toast.ts b/surfsense_web/lib/error-toast.ts index 6d0695a26..7905d8d53 100644 --- a/surfsense_web/lib/error-toast.ts +++ b/surfsense_web/lib/error-toast.ts @@ -1,6 +1,6 @@ import { toast } from "sonner"; -import { AbortedError, AppError, AuthenticationError, SURFSENSE_ISSUES_URL } from "./error"; import { detectEnvironment } from "./env-config"; +import { AbortedError, AppError, AuthenticationError, SURFSENSE_ISSUES_URL } from "./error"; /** * Build a GitHub issue URL pre-filled with diagnostic context.