Commit 29473ad
authored
feat: Add native Git hooks for automatic code formatting (#167)
* feat: add tmux-based development setup script
- Add setup.sh script to start all services in tmux session
- Add stop.sh script for graceful shutdown
- Add comprehensive development/README.md with setup instructions
- Include prerequisite checks for Go, Node.js, npm, Docker, and tmux
- Validate environment files before starting services
- Auto-install dependencies if missing
- Update main README.md with development setup section
Fixes #155
* docs: clarify environment setup and add documentation references
- Change backend/.env to ./backend/.env to avoid confusion
- Add note about running backend in separate user environment
- Clarify sync server startup command in service URLs
- Add CCSync documentation website references in setup.sh error messages
- Add documentation link for OAuth credential setup
* feat: add Husky pre-commit hooks for automatic code formatting
- Setup Husky v9.1.7 with lint-staged for pre-commit hooks
- Automatically run Prettier on staged frontend files (JS/TS/JSON/CSS/MD)
- Automatically run gofmt on staged backend Go files
- Add .prettierignore to exclude build artifacts and dependencies
- Update CONTRIBUTING.md with Husky setup information
- Add .husky/README.md for hook documentation
- Update .gitignore to exclude node_modules and package-lock.json at root
This prevents contributors from forgetting to run formatting commands
manually, ensuring consistent code style across all commits.
Fixes: #114
* chore: update Husky pre-commit hook for v10 compatibility
Remove deprecated shebang and husky.sh sourcing to prepare for Husky v10
* refactor: replace Husky with native Git hooks
- Remove Husky dependency and root package.json
- Add setup-git-hooks.sh script for native Git hook installation
- Maintain automatic formatting functionality for frontend and backend
- Update CONTRIBUTING.md with new setup instructions
This addresses maintainer feedback to avoid adding complexity with
a root package.json. Contributors run ./scripts/setup-git-hooks.sh
once after cloning to enable automatic code formatting.
Fixes: #114
* refactor: implement automated Git hooks setup via npm postinstall
- Created .githooks/pre-commit for native Git hook implementation
- Added postinstall script to automatically configure Git hooks on npm install
- Hook runs prettier for frontend files and gofmt for backend files
- Updated documentation to reflect automated setup process
- Removed manual setup script as hooks now configure automatically
Resolves maintainer feedback to avoid root package.json complexity1 parent 68f02cf commit 29473ad
7 files changed
Lines changed: 117 additions & 19 deletions
File tree
- .githooks
- development
- frontend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
53 | 64 | | |
54 | 65 | | |
55 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
407 | 410 | | |
408 | 411 | | |
409 | 412 | | |
| |||
0 commit comments