https://github.com/joyceerhl/vscode-git-fit-commit
Format commit messages in VS Code's source control input box
https://github.com/joyceerhl/vscode-git-fit-commit
git vscode-extension
Last synced: about 2 months ago
JSON representation
Format commit messages in VS Code's source control input box
- Host: GitHub
- URL: https://github.com/joyceerhl/vscode-git-fit-commit
- Owner: joyceerhl
- Created: 2023-09-05T17:56:17.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-14T12:05:02.000Z (almost 2 years ago)
- Last Synced: 2025-10-20T09:53:31.386Z (8 months ago)
- Topics: git, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=joyceerhl.git-commit-formatter
- Size: 3.6 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git 50/72 Commit Message Formatter
This is a Visual Studio Code extension that formats git commit messages in the source control input box according to the 50/72 rule. It also supports optional linting and quick fixes for missing `type:` subject line prefixes.
## Usage
1. Install the extension in VS Code.
2. Write a commit message in the source control view input box.
3. If either the subject line or the body exceeds the configured limit, a validation message will appear in the source control input box. Use the Quick Fix command (`Ctrl+.`) to access and run the `Format commit message` code action.

4. If your commit message lacks a `type:` prefix, a validation message will appear in the source control input box. Use the Quick Fix command (`Ctrl+.`) to access and run the `Add commit type` code action.

5. Happy committing!
## Configuration options
* Configure how long your commit message subject lines and bodies should be with the following settings:
- `git.inputValidationSubjectLength` (default: 50 chars)
- `git.inputValidationLength` (default: 72 chars)
* Enable `editor.formatOnType` to automatically format your commit message when you insert a newline.
* Configure how overly long subject lines should wrap when formatted with `gitCommit.subjectLine.overflowStrategy` (default: `split`)
* Configure whether you want validation and quick fixes for commit types in the subject line:
- `gitCommit.subjectLine.lint.enabled`: (default: `false`)
- `gitCommit.subjectLine.lint.types` (default: `feat:`, `fix:` [and other Conventional Commit types](https://www.conventionalcommits.org/en/v1.0.0/))
* Configure whether you want the formatter to strip multiple successive newlines:
- `gitCommit.collapseMultipleEmptyLines.enabled` (default: `false`)
## Development
### Prerequisites
- Node.js
- Visual Studio Code
### Setup
1. Clone the repository.
2. Run `npm install` to install the dependencies.
3. Open the project in VS Code.
### Build
Press `F5` to compile the extension source code and launch the extension development host.
### Test
Run `npm test` to run the tests.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](https://choosealicense.com/licenses/mit/)