Dotfile compliance: add root .editorconfig, harden .gitignore, exclude .git from .dockerignore #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Three root-level dotfiles diverge from the org models. Verified on
mainatfbfe1dfby diffing against thepromptsrepo.1. No root
.editorconfigREPO_POLICIES.mdrequires: "All repos should have an.editorconfigenforcing the project's indentation settings", and lists.editorconfigin the minimum file set. The repo hasbackend/.editorconfigbut nothing at the root, so the frontend (src/,index.html,vite.config.js,nginx.conf,script/) is unconstrained.backend/.editorconfigis already byte-identical to the org model, so the fix is to lift it to the root.2.
.gitignoreis missing the secrets and OS/editor sectionsCurrent
.gitignoreis 4 lines. Diff against the org model shows these entries missing:The secrets entries are the serious part.
REPO_POLICIES.md: "Never commit secrets..envfiles, credentials, API keys, and private keys must be in.gitignore. No exceptions." The backend loads.envviagodotenv, so an untracked-but-unignored.envhere is a live footgun.3.
.dockerignoredoes not exclude.gitThe org model
.dockerignorestarts with.git; this repo's does not. Everydocker buildtherefore ships the full git history into the build context.Note the interaction:
Dockerfile.backendcurrently doesCOPY .git /repo/.gitso thatbackend/Makefile'sgit describeworks. Adding.gitto.dockerignorewill break that build. Resolving that coupling is out of scope here — it is handled by the Dockerfile issue. For this commit, either sequence this issue after the Dockerfile rework, or add.gitto.dockerignoreonly once the backend build no longer needs it. Do not silently leave.gitin the context and tick the box.Definition of done
.editorconfigexists and is byte-identical tobackend/.editorconfig(which already matches the org model).backend/.editorconfigis deleted — a single root.editorconfigwithroot = truecovers the whole tree, and a duplicate in a subdirectory is redundant..gitignorecontains, at minimum, the OS, editor, node, and environment/secrets sections from the org model, including.env,.env.*,*.pem, and*.key..dockerignoreexcludes.git— or, if the backend build still requires.git, this bullet is explicitly deferred with a comment on this issue explaining why, and the issue stays open until it can be satisfied.git status --shortbeing clean after the change andgit ls-filesunchanged except for the intended.editorconfigmoves.make checkpasses at the repo root and inbackend/.TODO.mdupdated in the same commit.(closes #N).Implementation requirements
promptsclone orhttps://git.eeqj.de/sneak/prompts/raw/branch/main/<file>.maketargets andscript/entrypoints only.make fmtbefore committing.Implementation plan
Branching from
mainatfbfe1dfontochore/dotfile-compliance, working in athrowaway git worktree.
1. Root
.editorconfig(will do)git mv backend/.editorconfig .editorconfig. I diffedbackend/.editorconfigagainst/home/user/dev/prompts/.editorconfig— theyare byte-identical, so this is a pure move with no content change.
root = trueat the repo root then covers
src/,index.html,vite.config.js,nginx.conf,script/, andbackend/in one file.2.
.gitignore(will do)Start from the org model verbatim (copied from the local
promptsclone, nothand-authored), then re-append the two repo-specific entries the current file
carries that the model does not:
dist/(Vite output) and*.log. Result:# OS—.DS_Store,Thumbs.db# Editors—*.swp,*.swo,*~,*.bak,.idea/,.vscode/,*.sublime-*# Node—node_modules/# Environment / secrets—.env,.env.*,*.pem,*.key# Build output—dist/# Logs—*.logbackend/.gitignoreis left alone: its entries are backend-specific paths(
/netwatch-server,*.out,*.test,data/) and are out of scope here.3.
.dockerignore.gitexclusion — DEFERRING, explicitlyI am not adding
.gitto.dockerignorein this PR, and I am saying so ratherthan ticking the box. Both images read git metadata at build time on
mainatfbfe1df:Dockerfile.backendline 12 is literallyCOPY .git /repo/.git, becausebackend/Makefileshells out togit describefor the version stamp. A.dockerignoreentry would make thatCOPYfail outright — the build errors,it does not merely degrade.
DockerfiledoesCOPY . .and thenRUN make check, whose test step is theproduction
yarn build.vite.config.jslines 5-6 callgit rev-parse --short HEADandgit rev-parse HEADat config-eval time, soVite would throw before a single module is transformed.
So the bullet cannot be satisfied here without breaking
docker build .anddocker build -f Dockerfile.backend ., and un-coupling the builds from.git(build-arg version injection instead of in-container
git) is owned by theDockerfile issue, not this one. Per the definition of done's own escape hatch,
this issue should stay open after the PR merges, carrying only that one
remaining bullet.
Verification
git ls-filesbefore and after; the only permitted delta isbackend/.editorconfig->.editorconfig. This is the specific way to getthis change wrong, so it gets an explicit before/after diff rather than a
glance.
git status --shortclean after the change, confirming no tracked file wasswallowed by a new pattern (there are no tracked
.env/*.pem/*.key/.vscode//.idea/paths today — checked).make checkat the repo root andmake checkinbackend/.make fmtover theTODO.mdedit before committing.TODO.mdgets one additive line at the top of Completed Steps in the samecommit. I am deliberately not rewriting its Status/Next Step sections: PR #31 is
open and merge-ready and already rewrites exactly those, so touching them would
manufacture a conflict for no benefit.
Deferral notice for the
.dockerignorebulletPR #35 (
chore/dotfile-compliance,4a7bdf8) implements bullets 1 and 2. Bullet3 —
.dockerignoreexcluding.git— is explicitly deferred, per the escapehatch in this issue's own definition of done. Stating it plainly rather than
quietly ticking or quietly skipping it:
.dockerignoreis unmodified by that PR. Adding.gittoday breaks both imagebuilds on
mainatfbfe1df, and breaks them hard — build failure, not silentdegradation:
Dockerfile.backend:12is literallyCOPY .git /repo/.git, feedinggit describe --always --dirtyinbackend/Makefile. Ignoring.gitleavesthat
COPYwith no source and the build errors.DockerfiledoesCOPY . .thenRUN make check, whose test step is theproduction
vite build.vite.config.jslines 5-6 callgit rev-parse --short HEADandgit rev-parse HEADat config-eval time, soVite throws before transforming a single module. Note the frontend never
COPYs.gitdeliberately — it inherits it fromCOPY . ., which is exactlywhy the ignore entry bites there too.
Un-coupling the builds from in-container git metadata is #17's job for the
backend half; the frontend
vite.config.jshalf was not covered by any existingissue.
One deviation from the DoD, flagged
The DoD says this issue stays open until that bullet is satisfied, but the
commit title is required to end with
(closes #15), so merging #35 willauto-close this. To keep the residual work from evaporating I have filed #36,
which carries the
.dockerignorebullet plus thevite.config.jsdecoupling andis sequenced after #17. If you would rather keep #15 open as the tracking issue
instead, reopen it and close #36 as a duplicate — the work is identical either
way, this is just about which number carries it.
Other DoD bullets
.editorconfigexists,cmp-verified byte-identical to the org model.backend/.editorconfigdeleted (it was the source of thegit mv)..gitignorehas the OS, Editors, Node, and Environment/secrets sectionsverbatim from the model, plus this repo's
dist/and*.log.git ls-filesdiffers only by the.editorconfigrelocation,git check-ignoreover the whole tracked setmatches nothing,
git status --shortclean.make checkandcd backend && make checkboth pass.TODO.mdupdated in the same commit;make fmtrun beforehand.