Skip to content

docs: require formatting for every contribution#527

Merged
Ethan-Arrowood merged 1 commit into
mainfrom
format-contribution-guidance
Jun 11, 2026
Merged

docs: require formatting for every contribution#527
Ethan-Arrowood merged 1 commit into
mainfrom
format-contribution-guidance

Conversation

@Ethan-Arrowood

Copy link
Copy Markdown
Member

Summary

Formatting was already documented, but as advisory guidance rather than a hard gate — which is how unformatted files (the plans/ scaffolding in #520) slipped through. This tightens the contribution docs so future contributions, including agentic ones, treat formatting as a non-negotiable pre-PR step.

  • AGENTS.md — make npm run format:write / format:check a hard pre-commit/PR gate (not advisory), and clarify it applies to every file in the repo, not just docs content (so generated files under plans/, scripts/, etc. aren't missed).
  • CONTRIBUTING.md — add a dedicated Formatting section stating every contribution must be formatted and that CI enforces format:check.
  • README.md — left unchanged; it delegates to CONTRIBUTING.md and duplicating specifics would just risk drift.

🤖 Generated with Claude Code

Make `npm run format:write` a hard pre-commit/PR gate rather than
advisory guidance, and clarify it applies to every file in the repo
(not just docs content) so generated scaffolding under plans/, scripts/,
etc. is not missed. Add a dedicated Formatting section to CONTRIBUTING.md
noting CI enforces format:check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Ethan-Arrowood Ethan-Arrowood requested a review from a team as a code owner June 11, 2026 15:18

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates AGENTS.md and CONTRIBUTING.md to clarify that code formatting is a strict requirement before submitting a pull request, detailing the commands to format and check files, and explaining that CI will fail on unformatted code. The review comments suggest improving the documentation by explicitly listing .ts and .json file extensions in CONTRIBUTING.md to align with AGENTS.md, and clarifying the workflow steps (including pushing changes) when a CI formatting check fails.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread CONTRIBUTING.md

## Formatting

**Every contribution must be formatted before it is committed.** This applies to _all_ files in the repository — content (`.md`/`.mdx`), TypeScript, config, and anything else under `plans/`, `scripts/`, etc. — not just docs content.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To ensure consistency with the file types listed in AGENTS.md (which explicitly mentions .ts and .json), we can explicitly list these extensions here as well. This makes it clearer to contributors which file formats are subject to formatting checks.

For example:

**Every contribution must be formatted before it is committed.** This applies to _all_ files in the repository — content (`.md`/`.mdx`), TypeScript (`.ts`), JSON (`.json`), config, and anything else under `plans/`, `scripts/`, etc. — not just docs content.

Comment thread CONTRIBUTING.md
npm run format:check
```

CI runs `npm run format:check` on every pull request and will fail if anything is unformatted. If CI fails on formatting, run `npm run format:write` locally and commit the result. Prettier is configured via `@harperdb/code-guidelines/prettier` (see `package.json`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When CI fails on formatting, the contributor needs to run the format command, commit, and then push the changes back to the branch. Adding "and push" to the instructions makes the workflow complete and clear for contributors.

For example:

If CI fails on formatting, run `npm run format:write` locally, commit, and push the changes.

@github-actions github-actions Bot temporarily deployed to pr-527 June 11, 2026 15:21 Inactive
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-527

This preview will update automatically when you push new commits.

@dawsontoth dawsontoth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is to help the agents get it right before CI fails, and https://github.com/HarperFast/documentation/blob/main/.github/workflows/validate.yaml is working well too? As a harder gate to actually formatting.

@Ethan-Arrowood

Copy link
Copy Markdown
Member Author

Yes! I also opened #528 if we want to consider automating this as a commit hook.

@Ethan-Arrowood Ethan-Arrowood merged commit feea8f0 into main Jun 11, 2026
7 checks passed
@Ethan-Arrowood Ethan-Arrowood deleted the format-contribution-guidance branch June 11, 2026 21:01
@github-actions

Copy link
Copy Markdown

🧹 Preview Cleanup

The preview deployment for this PR has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants