-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MCP SDK: Add pre-commit/post-checkout/post-merge hooks #1003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
MCP SDK: Add pre-commit/post-checkout/post-merge hooks #1003
Conversation
… npm install on checkout and merge
What happens if the test(s) fail? I once had a colleague tell me they don't like putting things like tests in a pre-commit script because you should never stop a developer from committing their code. To be fair, this was in the context of employees working on a commercial software stack, not an open source SDK. Still, it has stuck with me and I think there is something to it. Example might be if a developer is going out of town for a week and wants to commit their work in progress on a feature. If it is failing a test and can't be committed, then no one else can pick it up while they are out. |
They can still do |
Appreciate the PR! Maybe we should discuss this in an in issue/discussion to figure out what we want to agree on? fwiw my view is that if you want to run things locally you always can, and if not CI will be there to catch this. I've personally found pre-commit/other hooks burn more of my time than they save, or are frustrating when trying to commit a WIP or draft piece of work (appreciate can use |
could we do pre-push by default, and make pre-commit optional? |
…cript-sdk into feature/ts-sdk-hooks
… into feature/ts-sdk-hooks
This is a great idea and alleviates a lot of the concerns. Done and pushed. cc @pcarleton |
This is a follow-up to #976 and it has a goal of improving DX experience, and reducing contributor friction by ensuring linting, formatting and tests are ran before commits.
It introduces the following:
Motivation and Context
PRs could get slowed down by failing when there is an accidental omission by the contributor to run lint/test/code format before committing.
Introducing this change will reduce contributor friction.
How Has This Been Tested?
Tested pre-commit with staged files, pre-commit with all files (
npx lefthook run pre-commit --all-files
)Breaking Changes
No breaking changes, a pure DX change.
Types of changes
Checklist