Skip to content

Commit 2e05b78

Browse files
committed
build: commit hooks
1 parent b4f26dd commit 2e05b78

File tree

15 files changed

+1444
-59
lines changed

15 files changed

+1444
-59
lines changed

CONTRIBUTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing to Fezcodex
2+
3+
We follow the **Conventional Commits** specification to keep our history clean and meaningful. This also helps in generating changelogs and understanding the scope of changes at a glance.
4+
5+
## Commit Message Format
6+
7+
Each commit message consists of a **header**, a **body**, and a **footer**. The header has a special format that includes a **type**, a **scope**, and a **subject**:
8+
9+
```
10+
<type>(<scope>): <subject>
11+
<BLANK LINE>
12+
<body>
13+
<BLANK LINE>
14+
<footer>
15+
```
16+
17+
### Types
18+
19+
Must be one of the following:
20+
21+
- **feat**: A new feature (e.g., `feat: add new achievements system`)
22+
- **fix**: A bug fix (e.g., `fix: correct layout on mobile`)
23+
- **docs**: Documentation only changes (e.g., `docs: update readme`)
24+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
25+
- **refactor**: A code change that neither fixes a bug nor adds a feature
26+
- **perf**: A code change that improves performance
27+
- **test**: Adding missing tests or correcting existing tests
28+
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
29+
- **content**: **(Project Specific)** Adding or updating content such as:
30+
- Blog posts (`content(blog): add new post about react`)
31+
- Logs (`content(log): add review for new movie`)
32+
- Projects (`content(project): add details for new app`)
33+
- Music/Sounds (`content(audio): add new ambient track`)
34+
- Assets (`content(assets): update avatar image`)
35+
36+
### Scope (Optional)
37+
38+
The scope provides additional context to the type. For `content` types, the scope is highly recommended (e.g., `blog`, `log`, `project`).
39+
40+
### Subject
41+
42+
The subject contains a succinct description of the change:
43+
- Use the imperative, present tense: "change" not "changed" nor "changes"
44+
- Don't capitalize the first letter
45+
- No dot (.) at the end
46+
47+
### Body (Optional)
48+
49+
Just as in the **subject**, use the imperative, present tense. The body should include the motivation for the change and contrast this with previous behavior.
50+
51+
### Footer (Optional)
52+
53+
The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit closes.
54+
55+
## Example
56+
57+
```
58+
content(log): add corrupted blood incident rant
59+
60+
- Added new text file for the post
61+
- Updated posts.json with metadata
62+
- Added unique category color for 'rant'
63+
```

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ npm run deploy
7474
---
7575

7676
## Rules of the House
77+
- **Contributing:** Please read our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on commit messages and content updates.
7778
- Styling: We use Tailwind. Keep it Brutalist yet polished.
7879
- Icons: We use @phosphor-icons/react. Always use the ones ending in Icon (for example, CpuIcon).
7980
- Logic: Keep it simple. Use Context for global settings like Visual Effects and Animations.

commitlint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'feat',
9+
'fix',
10+
'docs',
11+
'style',
12+
'refactor',
13+
'perf',
14+
'test',
15+
'chore',
16+
'revert',
17+
'ci',
18+
'build',
19+
'content', // Custom type for Fezcodex content
20+
],
21+
],
22+
},
23+
};

git-hooks/commit-msg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
# Native git hook to run commitlint via node script
3+
node scripts/verify-commit.js "$1"

0 commit comments

Comments
 (0)