You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,48 @@ Prerequisites
33
33
## API Guide
34
34
Detailed information on API endpoints can be found in the [API Guide](https://piramal-swasthya.gitbook.io/amrit/architecture/api-guide).
35
35
36
+
## Setting Up Commit Hooks
37
+
38
+
This project uses Git hooks to enforce consistent code quality and commit message standards. Even though this is a Java project, the hooks are powered by Node.js. Follow these steps to set up the hooks locally:
39
+
40
+
### Prerequisites
41
+
- Node.js (v18 or later)
42
+
- npm (comes with Node.js)
43
+
44
+
### Setup Steps
45
+
46
+
1.**Install Node.js and npm**
47
+
- Download and install from [nodejs.org](https://nodejs.org/)
48
+
- Verify installation with:
49
+
```
50
+
node --version
51
+
npm --version
52
+
```
53
+
2. **Install dependencies**
54
+
- From the project root directory, run:
55
+
```
56
+
npm ci
57
+
```
58
+
- This will install all required dependencies including Husky and commitlint
59
+
3. **Verify hooks installation**
60
+
- The hooks should be automatically installed by Husky
61
+
- You can verify by checking if the `.husky` directory contains executable hooks
62
+
### Commit Message Convention
63
+
This project follows a specific commit message format:
64
+
- Format: `type(scope): subject`
65
+
- Example: `feat(login): add remember me functionality`
66
+
Types include:
67
+
- `feat`: A new feature
68
+
- `fix`: A bug fix
69
+
- `docs`: Documentation changes
70
+
- `style`: Code style changes (formatting, etc.)
71
+
- `refactor`: Code changes that neither fix bugs nor add features
72
+
- `perf`: Performance improvements
73
+
- `test`: Adding or fixing tests
74
+
- `build`: Changes to build process or tools
75
+
- `ci`: Changes to CI configuration
76
+
- `chore`: Other changes (e.g., maintenance tasks, dependencies)
77
+
Your commit messages will be automatically validated when you commit, ensuring project consistency.
36
78
37
79
## Usage
38
80
All features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details.
0 commit comments