feat: add git commit message template and setup
- Create .gitmessage template with conventional commits format - Add .gitattributes for consistent line endings across platforms - Update CONTRIBUTING.md with template setup instructions - Update README.md development setup section - Template includes type reference, examples, and formatting guidance - Helps ensure consistent commit messages that pass gitlint validation The template guides contributors to write proper conventional commits and explains breaking change syntax, character limits, and best practices for consistent messaging.
This commit is contained in:
parent
ac64d82871
commit
da3a256848
4 changed files with 96 additions and 7 deletions
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Ensure consistent line endings across platforms
|
||||
* text=auto
|
||||
|
||||
# Force LF line endings for specific file types
|
||||
*.py text eol=lf
|
||||
*.yaml text eol=lf
|
||||
*.yml text eol=lf
|
||||
*.json text eol=lf
|
||||
*.md text eol=lf
|
||||
*.rst text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.cfg text eol=lf
|
||||
*.ini text eol=lf
|
||||
*.toml text eol=lf
|
||||
|
||||
# Git-specific files
|
||||
.gitignore text eol=lf
|
||||
.gitattributes text eol=lf
|
||||
.gitmessage text eol=lf
|
||||
|
||||
# Scripts should use LF
|
||||
*.sh text eol=lf
|
||||
|
||||
# Binary files
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
*.gif binary
|
||||
*.ico binary
|
||||
*.pdf binary
|
||||
*.zip binary
|
||||
*.tar.gz binary
|
||||
|
||||
# Documentation images
|
||||
*.webp binary
|
40
.gitmessage
Normal file
40
.gitmessage
Normal file
|
@ -0,0 +1,40 @@
|
|||
# <type>[optional scope][optional !]: <description>
|
||||
#
|
||||
# [optional body]
|
||||
#
|
||||
# [optional footer(s)]
|
||||
|
||||
# --- COMMIT END ---
|
||||
# Type can be:
|
||||
# feat (new feature)
|
||||
# fix (bug fix)
|
||||
# docs (documentation)
|
||||
# style (formatting, no code change)
|
||||
# refactor (refactoring production code)
|
||||
# test (adding tests, refactoring test; no production code change)
|
||||
# chore (updating build process or auxiliary tools; no production code change)
|
||||
# ci (changes to CI configuration files and scripts)
|
||||
# build (changes that affect the build system or dependencies)
|
||||
# perf (performance improvements)
|
||||
# revert (reverting a previous commit)
|
||||
#
|
||||
# Scope is optional and should be a noun describing the section of codebase
|
||||
# Examples: (api), (ui), (config), (tests), (docs)
|
||||
#
|
||||
# Use ! after type/scope to indicate breaking changes: feat!, fix(api)!
|
||||
#
|
||||
# Breaking change footer format:
|
||||
# BREAKING CHANGE: description of the breaking change
|
||||
#
|
||||
# Remember:
|
||||
# - Use imperative mood in the description ("add" not "added")
|
||||
# - Don't end the description with a period
|
||||
# - Keep first line under 50 characters
|
||||
# - Wrap body at 72 characters
|
||||
# - Separate body and footer with blank lines
|
||||
#
|
||||
# Examples:
|
||||
# feat: add user authentication
|
||||
# fix(api): handle null response from external service
|
||||
# feat!: remove deprecated login endpoint
|
||||
# docs: update installation instructions
|
|
@ -14,9 +14,17 @@ Thank you for your interest in contributing to **doi2dataset**! We welcome contr
|
|||
```bash
|
||||
pip install -r requirements-dev.txt
|
||||
```
|
||||
4. **Make** your changes
|
||||
5. **Test** your changes (see [Testing](#testing) below)
|
||||
6. **Submit** a pull request
|
||||
4. **Set up** commit message template (recommended):
|
||||
```bash
|
||||
git config commit.template .gitmessage
|
||||
```
|
||||
5. **Install** pre-commit hooks (recommended):
|
||||
```bash
|
||||
pre-commit install --hook-type pre-commit --hook-type commit-msg
|
||||
```
|
||||
6. **Make** your changes
|
||||
7. **Test** your changes (see [Testing](#testing) below)
|
||||
8. **Submit** a pull request
|
||||
|
||||
## How to Contribute
|
||||
|
||||
|
|
14
README.md
14
README.md
|
@ -403,19 +403,25 @@ Contributions are welcome! Please fork the repository and submit a pull request
|
|||
pip install -r requirements-dev.txt
|
||||
```
|
||||
|
||||
2. Install pre-commit hooks (recommended):
|
||||
2. Set up commit message template (recommended):
|
||||
|
||||
```bash
|
||||
pre-commit install --hook-type commit-msg
|
||||
git config commit.template .gitmessage
|
||||
```
|
||||
|
||||
3. Run tests to ensure everything works:
|
||||
3. Install pre-commit hooks (recommended):
|
||||
|
||||
```bash
|
||||
pre-commit install --hook-type pre-commit --hook-type commit-msg
|
||||
```
|
||||
|
||||
4. Run tests to ensure everything works:
|
||||
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
|
||||
4. Optionally run pre-commit on all files to check formatting:
|
||||
5. Optionally run pre-commit on all files to check formatting:
|
||||
|
||||
```bash
|
||||
pre-commit run --all-files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue