From 54106a57915eebc3e2c52c106b3e1adc51160997 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Fri, 21 Nov 2025 10:42:21 +0100 Subject: [PATCH] CI: Document "make lint", "make lint-go", & "make lint-js" targets #5330 Signed-off-by: Michael Mayer --- AGENTS.md | 3 ++- CODEMAP.md | 3 ++- frontend/CODEMAP.md | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index bcdb7487d..a400e89be 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # PhotoPrism® Repository Guidelines -**Last Updated:** November 14, 2025 +**Last Updated:** November 21, 2025 ## Purpose @@ -141,6 +141,7 @@ Note: Across our public documentation, official images, and in production, the c - From within the Development Environment: - Full unit test suite: `make test` (runs backend and frontend tests) - Test frontend/backend: `make test-js` and `make test-go` + - Linting: `make lint` (all), `make lint-go` (golangci-lint with `.golangci.yml`, prints findings without failing due to `--issues-exit-code 0`), `make lint-js` (ESLint/Prettier) - Go packages: `go test` (all tests) or `go test -run ` (specific tests only) - Need to inspect the MariaDB data while iterating? Connect directly inside the dev shell with `mariadb -D photoprism` and run SQL without rebuilding Go code. - Go tests live beside sources: for `path/to/pkg/.go`, add tests in `path/to/pkg/_test.go` (create if missing). For the same function, group related cases as `t.Run(...)` sub-tests (table-driven where helpful) and use **PascalCase** for subtest names (for example, `t.Run("Success", ...)`). diff --git a/CODEMAP.md b/CODEMAP.md index ada2e766e..84ea33844 100644 --- a/CODEMAP.md +++ b/CODEMAP.md @@ -1,6 +1,6 @@ PhotoPrism — Backend CODEMAP -**Last Updated:** November 14, 2025 +**Last Updated:** November 21, 2025 Purpose - Give agents and contributors a fast, reliable map of where things live and how they fit together, so you can add features, fix bugs, and write tests without spelunking. @@ -10,6 +10,7 @@ Quick Start - Inside dev container (recommended): - Install deps: `make dep` - Build backend: `make build-go` + - Lint Go (golangci-lint): `make lint-go` (uses `.golangci.yml`; prints findings without failing) or run both stacks with `make lint` - Run server: `./photoprism start` - Open: http://localhost:2342/ or https://app.localssl.dev/ (Traefik required) - On host (manages Docker): diff --git a/frontend/CODEMAP.md b/frontend/CODEMAP.md index ace9ef550..b5eb6cc36 100644 --- a/frontend/CODEMAP.md +++ b/frontend/CODEMAP.md @@ -1,6 +1,6 @@ PhotoPrism — Frontend CODEMAP -**Last Updated:** November 17, 2025 +**Last Updated:** November 21, 2025 Purpose - Help agents and contributors navigate the Vue 3 + Vuetify 3 app quickly and make safe changes. @@ -83,7 +83,7 @@ Testing Build & Tooling - Webpack is used for bundling; scripts in `frontend/package.json`: - `npm run build` (prod), `npm run build-dev` (dev), `npm run watch` - - Lint/format: `npm run lint`, `npm run fmt` + - Lint/format: `npm run lint` or `make lint-js`; repo root `make lint` runs both backend (golangci-lint via `.golangci.yml`) and frontend linters - Security scan: `npm run security:scan` (checks `--ignore-scripts` and forbids `v-html`) - Licensing: run `make notice` from the repo root to regenerate `NOTICE` files after dependency changes—never edit them manually. - Make targets (from repo root): `make build-js`, `make watch-js`, `make test-js`