Thank you for your interest in contributing to nullvariant-vscode-extensions!
The main branch is protected with the following rules:
- Pull Request required: All changes must go through a PR (direct push is disabled)
- CI status checks: The
buildcheck must pass before merging - Signed commits required on main: Commits merged to
mainmust be GPG signed (handled by maintainers during merge) - Linear history: Rebase/squash merging is required (no merge commits)
Note for contributors: You don't need to GPG-sign your commits. The maintainer will handle signing when merging your PR.
This project requires all contributors to sign off their commits, certifying that they have the right to submit the code under the project's license. This is enforced via the Developer Certificate of Origin.
Add --signoff (or -s) to your git commit command:
git commit --signoff -m "feat: add new feature"This adds a Signed-off-by line to your commit message:
feat: add new feature
Signed-off-by: Your Name <your.email@example.com>
By signing off, you certify the Developer Certificate of Origin v1.1 (full text at the link). Key points:
- The contribution is your original work, or you have the right to pass it on
- You have the right to submit it under the project's open source license
- You understand the contribution is public and a record of it is maintained indefinitely
Note: If you forget
--signoff, the DCO check on your PR will fail. You can fix existing commits withgit commit --amend --signofforgit rebase --signoff HEAD~N.
- Fork the repository
- Clone your fork
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Commit with
--signoff:git commit --signoff -m "feat: description" - Push to your fork
- Open a Pull Request
- Wait for CI checks to pass (including DCO), then a maintainer will merge
# Clone
git clone https://github.com/your-username/nullvariant-vscode-extensions.git
cd nullvariant-vscode-extensions
# Set up git hooks (recommended)
git config core.hooksPath .githooks
# Install dependencies
npm install
# Work on an extension
cd extensions/git-id-switcher
npm install
npm run watch- Use TypeScript
- Follow existing code patterns
- Add comments for complex logic
- Keep functions focused and small
- Open the extension folder in VS Code
- Press
F5to launch Extension Development Host - Test your changes manually
cd extensions/git-id-switcher
npm run testE2E (End-to-End) tests run in an actual VS Code environment using @vscode/test-electron and verify the extension works correctly as a whole.
- Node.js 20+
- On first run, VS Code will be downloaded automatically (~100MB)
cd extensions/git-id-switcher
npm run test:e2eE2E test files are located in src/test/e2e/. When adding new E2E tests:
- Create a test file in
src/test/e2e/(e.g.,myFeature.test.ts) - Use the VS Code Test API (
@vscode/test-electron) - Test real extension behavior without mocks
- Clean up any test data after tests complete
When testing UI modules (StatusBar, QuickPick, Documentation), follow these patterns:
StatusBar Tests:
- Test state transitions:
setIdentity(),setNoIdentity(),setLoading(),setError() - Verify status bar item visibility and text updates
- Use
statusBar.dispose()in afterEach for cleanup
QuickPick Tests:
- Modify configuration → call item generation function → verify items
- Use
vscode.workspace.getConfiguration().update()for temporary config changes - Restore original configuration in afterEach
Documentation (Webview) Tests:
-
Limitation: Cannot directly access Webview DOM from tests
-
Use command execution + extension stability verification pattern:
await vscode.commands.executeCommand("git-id-switcher.showDocumentation"); assert.strictEqual( extension.isActive, true, "Extension should remain active", );
-
Test panel lifecycle: create → close → re-create
-
Add stress tests (rapid open/close) to detect resource leaks
-
Set appropriate timeout (e.g.,
this.timeout(15000)) for network operations
E2E tests run automatically in GitHub Actions CI:
- Executed in parallel with the build job
- Uses
xvfb-runfor headless execution on Linux - Currently set as non-blocking (
continue-on-error: true)
- Describe what your PR does
- Reference any related issues
- Keep changes focused
- Update documentation if needed
Feel free to open an issue for discussion.
By contributing, you agree that your contributions will be licensed under the MIT License.
- GOVERNANCE.md — Project governance model
- CODE_OF_CONDUCT.md — Garden etiquette
- SECURITY.md — Security policy and vulnerability reporting
- AGENTS.md — Constraints for AI-assisted contributions
- Translation Contributing Guide — How to contribute translations for Git ID Switcher