ftkit verify
Verify that a repository follows the Fountain standard.
Usage
bash
ftkit verifyThe command is also available under the alias v:
bash
ftkit vIt takes no arguments and runs against the current service repository.
What it does
verify runs a suite of 20 checks over the service in the current directory and prints, for each check, a list of passes (✓), warnings (⚠) and errors (✗). At the end it prints a summary with the total counts.
The 20 checks cover, in order:
- Project structure — required directories (
server,biz,biz/core,biz/dal),go.modand a config file. main.go—package main, the fountain bootstrap pattern, server creation, and aServing()call.server/server.go— blank import ofbiz, theserverstruct,NewServer(), the lifecycle methods (Initialize,Serving,Destroy,Info) and the install order inInitialize().server/route.go—initHTTPHandle, API versioning, route groups and handler references.biz/biz.go— blank imports for controller domains underbiz/core/*.- Controllers — each domain calls
RegisterCoreController()and implementsInstallController()/RegisterCallback(), usingsync.Once. controller.gocontents — onlyCoreController-related functions plusinit()/Get*ControllerInstance().- Handlers — each handler domain has an
*_impl.gowith aNew*API()constructor that takes[]core.CoreController. - Handler files — naming
{group}.{operation}_handler.goand exactly one handler function per file. - No route handlers in
*_impl.go— methods taking*fiber.Ctxmust live in*_handler.go. - DAO layer —
biz/dal/dao/managers.go, its constants,init()andRegisterDAO*usage, plus models. - DAO import rules — DB DAOs vs. cache DAOs and what they may import (currently advisory).
- DAO ownership — each DAO belongs to a single controller and is touched from a single file.
- DAO type suffix —
GetDAO[...]type parameters inInstallController()must end inDAO,CacheorSTO. - Logging — only
flogis allowed;log,slog, logrus, zap, zerolog andfmt.Print*-as-logging are flagged. - No data structs — controller, DAO and handler files must not declare data structs (those belong in
biz/dal/do). - Controller errors — exported controller functions must return
*froto.RpcError, not plainerror. - No
interface{}/anyparams — in controller files other thancontroller.go. pkg/directory — and the client library (<service>_client/).- Go file headers — reports the percentage of files carrying the standard header.
For the full, human-readable list of the conventions these checks enforce, see the Standards Checklist.
Exit behavior
- If any errors are found,
verifyprints a numbered list of the errors and exits with a non-zero status (exit 1) — useful for CI gates. - If there are warnings but no errors, it reports the repo as conformant with caveats and exits successfully.
- If there are no errors and no warnings, it reports the repo as fully conformant.
TIP
For check 20 (headers), verify suggests running ftkit header to automatically add the missing file headers.
verify has no flags.