ci: enforce black + prettier via pre-commit + lint workflow#15
Merged
Conversation
Add .pre-commit-config.yaml (black for Python; prettier for md/yaml/json; whitespace/EOF/yaml/merge-conflict checks) so `git commit` auto-formats locally after `pre-commit install`. A lint workflow runs the same hooks on every PR and push to main, so the config is the single source of truth for both. Also applies the first formatting pass (emphasis markers, bracket spacing, JSON layout) so the repo is already clean under the new hooks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add CONTRIBUTING.md (issues, Conventional Commits, pre-commit formatters, Discord) modeled on livepeer/explorer's guide, and link it from the README. Shorten the .pre-commit-config.yaml header comments. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enforce formatting so nothing merges unformatted — the low-friction standard for a Python + Markdown repo.
What
.pre-commit-config.yaml— black (Python), prettier (md/yaml/json), plus whitespace/EOF/yaml/merge-conflict checks. Afterpre-commit install, these run ongit commitand auto-fix..github/workflows/lint.yml— runs the same hooks on every PR and push to main. The YAML config is the single source of truth for local and CI.proseWrap: preserveleaves hand-wrapped paragraphs alone.How devs use it
uvx pre-commit install # once per clone; hooks then run on git commitCI catches anyone who skips it locally. Make the
lintcheck required in branch protection to gate merges.