Repository navigation
pre-commit: add a lint hook for a repository's own server - #175
Open
abu-tahir-0 wants to merge 1 commit into
Open
abu-tahir-0 wants to merge 1 commit into
abu-tahir-0 wants to merge 1 commit into
Conversation
The hooks only scanned a running endpoint. toolgauge-lint takes the stdio server command as one argument, reads its manifest on every commit, and needs neither Docker nor an endpoint.
This branch has not been deployed
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.
Problem
Both published hooks scan a running endpoint. A repository that ships a stdio MCP server had no pre-commit path to lint its own tool manifest. Closes #147.
Solution
toolgauge-linthook:entry: toolgauge lint --command,language: system,pass_filenames: false, stagespre-commitandmanual.argsentry so a command containing spaces stays a single argument:docs/USING.mdlists it next to the scan hooks.Testing
tests/harness/test_distribution.py— the existing hook test now distinguishes the two scan hooks from the lint hook: false filenames, system language,pre-commitstage, entry ends in--command, and every flag the entry uses is read from the reallintcommand definition.pytest tests/harness/test_distribution.py— 11 passed.ruff check .— clean.lint --command "node dist/server.js"form itself is covered end to end bytests/harness/test_stdio_lint.py, which starts a stdio server and lints it.Impact
A repository can fail a commit on a missing tool description without running an endpoint or Docker.