Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"body-leading-blank": [1, "always"],
"body-max-line-length": [2, "always", 100],
"footer-leading-blank": [1, "always"],
"footer-max-line-length": [2, "always", 100],
"header-max-length": [2, "always", 100],
"subject-case": [
2,
"never",
["sentence-case", "start-case", "pascal-case", "upper-case"]
],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test"
]
]
}
}
3 changes: 3 additions & 0 deletions .github/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"]
};
21 changes: 21 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint Commit Messages

on:
pull_request:
branches: [ main ]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Check commit messages
run: |
npx commitlint --config .commitlintrc.json --from="${{ github.event.pull_request.base.sha }}" --to="${{ github.sha }}"
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ target/
!.mvn/wrapper/maven-wrapper.jar
command_output.log

### Java ###
hs_err_pid*.log
replay_pid*.log

### Node.js ###
node_modules/
npm-debug.log
yarn-debug.log*
yarn-error.log*
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

### STS ###
.apt_generated
.classpath
Expand Down
2 changes: 2 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
npm run commitmsg -- "$1"
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run tests if they exist
npm run test:ci
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file about? I don't see this command in package.json scripts.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, @drtechie ,
The pre-commit hook has been updated to use lint-staged instead of the placeholder test command. This change is more meaningful because it actually performs code quality checks on staged files before commits, running ESLint and Prettier on JavaScript/TypeScript files, and Prettier on JSON/Markdown files. This ensures consistent code formatting and quality across the repository.
Also, I've excluded log files from being checked in .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohan-019 the test:ci script in package.json does nothing.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic"
}
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@

This service is used to generate unique beneficiary registration Id for new beneficiaries.

## Commit Message Standards
This project follows the [Conventional Commits](https://www.conventionalcommits.org/) specification. Commit messages must follow this format:

```
<type>(<scope>): <description>

[optional body]

[optional footer(s)]
```

### Types
- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation only changes
- `style`: Changes that do not affect the meaning of the code
- `refactor`: A code change that neither fixes a bug nor adds a feature
- `perf`: A code change that improves performance
- `test`: Adding missing tests or correcting existing tests

### Tools
- Commitlint: Enforces commit message format
- Husky: Git hooks for pre-commit checks
- Commitizen: Interactive commit message creation

## Building From Source
This microservice is built on Java, Spring boot framework and MySQL DB.

Expand Down Expand Up @@ -37,5 +62,5 @@ If you encounter any issues, bugs, or have feature requests, please file them in

## Join Our Community

Wed love to have you join our community discussions and get real-time support!
We'd love to have you join our community discussions and get real-time support!
Join our [Discord server](https://discord.gg/FVQWsf5ENS) to connect with contributors, ask questions, and stay updated.
Loading