Thanks for taking the time to contribute!
- Go (see
go.modfor the required version)
go mod downloadgo run ./... --helpRun these before opening a PR:
gofmt -w $(git ls-files '*.go')
go vet ./...
go test ./...Use these opt-in commands when working on higher-level test coverage:
# Contract fixture decode checks
go test ./internal/niconico -run TestNicoDataContract -count=1
# Fuzz smoke run (short)
go test ./... -run=^$ -fuzz=Fuzz -fuzztime=10s
# E2E against real API (requires env var)
GO_NICO_LIST_E2E_USER_ID=<user-id> go test -tags=e2e ./internal/niconico -run TestGetVideoListE2E -count=1
# Bench baseline
go test ./internal/niconico -run=^$ -bench=BenchmarkNiconicoSort -benchmem -count=1If your change updates dependencies (changes go.mod / go.sum), run:
go mod tidyIf your change updates dependencies (changes go.mod / go.sum), also update:
bash scripts/gen-third-party-notices.shThe script uses go-licenses (pinned in the script) and excludes test-only dependencies by default.
Set GO_LICENSES_SAVE_PATH when you also want to save license texts to a directory.
Requires bash and network access.
main.go: bootstrap (version, cancelable context)cmd/: CLI (flags, IO, validation, concurrency, exit codes)internal/niconico/: domain logic (fetch, retry, sorting, types)
If the user-facing behavior changes, update README.md and docs/DESIGN.md.
If the idea is not finalized yet, keep it out of docs/DESIGN.md and track it in a GitHub Issue.
Keep WORKLOG.md local-only (git-ignored); do not commit it.
- Add docstrings for all non-test functions, methods, and types.
- Start docstrings with the identifier name and keep them to a single sentence when possible.
- Test functions (
Test*,Benchmark*,Example*) are exempt. - Docstrings for
const/varare optional; add them when intent is non-obvious.
- Keep diffs small and focused.
- Avoid adding new runtime dependencies without prior discussion.
- Releases are performed by the maintainer.
- CI runs on pull requests to
masterand pushes tomaster. masteris protected by a repository ruleset: changes must go through PRs, require conversation resolution, and pass the requiredgo-cistatus check.- CI checks generated-file drift (
go mod tidy,go generate ./...,git diff --exit-code). - CI checks
THIRD_PARTY_NOTICES.mddrift (bash scripts/gen-third-party-notices.sh+ diff check). - CI runs gofmt, go vet, go test, and go test -race.
- Workflow actions are pinned by commit SHA. When upgrading action versions, update the pinned SHAs intentionally.
- Include an auto-close keyword for related issues (e.g.
Closes #123) in the PR body. - After addressing review feedback, request a Codex re-review in chat.
- When using
gh pr create, always use--body-filewith.github/PULL_REQUEST_TEMPLATE.mdto avoid literal\nin the description.
- Ensure master is green and up to date.
- If a versioned milestone is complete, release using the same version number.
- Create and push a version tag:
vX.Y.Z.- Release tags are protected by a repository ruleset for
refs/tags/v*.
- Release tags are protected by a repository ruleset for
- GitHub Actions runs the release workflow, verifying generated files (
go mod tidy,go generate ./...) and running gofmt/go vet/go test/go test -race. - The workflow regenerates
THIRD_PARTY_NOTICES.mdand fails if it is out of date. - GoReleaser publishes the GitHub Release and uploads artifacts.
- After the release workflow succeeds, close the milestone.
- Use
masteras the only long-lived branch. - Create short-lived branches (e.g.
feature/*) and merge via squash PR intomaster. - Tags for releases (
vX.Y.Z) are cut frommaster.
- CI must be green (generated files, third-party notices, gofmt, go vet, go test, go test -race).
- If behavior changes, add or update tests; otherwise explain why in the PR.
- If user-facing behavior changes, update README.md and docs/DESIGN.md.
- If dependencies change, run
go mod tidyand updateTHIRD_PARTY_NOTICES.md. - Breaking changes must be called out in the PR and docs.
- Use
type: summary(Conventional Commits style), e.g.fix: handle empty output. - Allowed types:
feat,fix,docs,ci,chore,refactor,test,build. - Keep the summary on the first line.
- For complex changes (multiple files or behavior changes), add a blank line, then details from line 3 onward.
- When Codex is used, add the trailer line:
AI-Assisted: Codex.
Example:
refactor: split client package
- move fetch/retry/sort into internal/niconico
- update tests to match new entry points
Please use the issue templates and include:
- your OS / shell
- tool version (
go-nico-list --version) - the exact command you ran
- whether the issue is reproducible
- expected vs actual behavior
- any relevant logs (stderr or
--logfileoutput)
Use status labels to separate confirmed items from open questions:
confirmed: use when the owner decides the issue is confirmed.needs-decision: use when the idea is not finalized yet.needs-clarification: use when more information is required from the reporter, and remove it once clarified.