-
Notifications
You must be signed in to change notification settings - Fork 28
feat(commit): setup Husky, Commitlint,Commitzen #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
blazethunderstorm
wants to merge
1
commit into
PSMRI:develop
Choose a base branch
from
blazethunderstorm:aniru
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Commit Compliance | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| commitlint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code with submodule | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| submodules: true | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci --legacy-peer-deps | ||
|
|
||
| - name: Run commitlint on PR | ||
| run: | | ||
| npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx --no -- commitlint --edit $1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx lint-staged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,66 +1,78 @@ | ||
| # AMRIT - Early Childhood Developemnt (ECD) Service | ||
|
|
||
| [](https://www.gnu.org/licenses/gpl-3.0) | ||
|  | ||
|
|
||
| The Early Childhood Development (ECD) Initiative by the Ministry of Health and Family Welfare (MoHFW) aims to nurture the cognitive capital of the country by enabling young children to attain their fullest potential. The initiative focuses on the critical period of brain development, which includes the 270 days of pregnancy and the first two years of the child's life, also known as the first 1,000 days. | ||
|
|
||
| ## Features of Early Childhood Developemnt (ECD) | ||
|
|
||
| - **Focus on the first 1,000 days:** Recognize the critical period of brain development and emphasize the importance of interventions during this period to promote physical, cognitive, social, and emotional development. | ||
|
|
||
| - **Communicate with mothers and families:** Acknowledge the vital role of mothers in the holistic development of their children. Develop simple, effective, and personalized messages to communicate with mothers and other family members, highlighting their significant impact on the child's overall development. | ||
|
|
||
| - **Reinforce messages through multiple channels:** Establish a unified approach by involving other health providers like ASHA, ANM, and medical officers to reiterate the same messages to caregivers. Consistent information is essential to ensure that parents receive comprehensive guidance. | ||
|
|
||
| - **Provide credible advice:** Train resources in the field of early childhood development to deliver information and counseling through the ECD Call Centre. The trained personnel will provide credible advice, enhancing the caregivers' trust in the information provided. | ||
|
|
||
| - **Offer personalized advice:** Utilize the interactive platform of the ECD Call Centre to provide personalized advice to parents based on their specific needs and their child's requirements. Building on existing positive practices, suggest additional actions that caregivers can take to promote their child's development. | ||
|
|
||
| - **Enhance caregivers' knowledge:** Emphasize the importance of caregivers' knowledge about early childhood development. Provide them with information and resources to better understand their child's developmental needs and milestones. | ||
|
|
||
| - **Boost caregivers' confidence:** Empower caregivers to feel confident in their abilities to support their child's development. Encourage them to take simple but meaningful actions that contribute positively to their child's growth. | ||
|
|
||
| - **Collaborate with other initiatives:** Complement existing initiatives such as LaQshya, Homebased Care for Young Child, and the Comprehensive New Born Screening under RBSK. By working collaboratively, ensure a comprehensive and integrated approach to early childhood development. | ||
|
|
||
| - **Foster a nature-friendly environment:** Promote the importance of creating a stimulating, loving, and protective care environment for children. Encourage activities that connect children with nature and promote their overall well-being. | ||
|
|
||
| - **Continuously evaluate and improve:** Regularly assess the effectiveness of the ECD initiative and the ECD Call Centre. Seek feedback from parents and caregivers to identify areas for improvement and refine the messages and services provided. | ||
|
|
||
| ## Building From Source | ||
|
|
||
| This microservice is built using Java and the Spring Boot framework, with MySQL as the underlying database. Before building the ECD module, ensure you have the following prerequisites: | ||
|
|
||
| - JDK 17 | ||
| - Maven | ||
| - Redis | ||
| - Spring Boot V2 | ||
| - MySQL | ||
|
|
||
| To build the ECD module from source, follow these steps: | ||
|
|
||
| 1. Clone the repository to your local machine. | ||
| 2. Install the required dependencies and build the module using the following command: | ||
| - Execute the following command: | ||
| ``` | ||
| mvn clean install | ||
| ``` | ||
| 3. You can copy `ecd_example.properties` to `ecd_local.properties` and edit the file accordingly. The file is under `src/main/environment` folder. | ||
| 4. Run the spring server with local configuration `mvn spring-boot:run -DENV_VAR=local` | ||
|
|
||
| - Open your browser and navigate to http://localhost:8080/swagger-ui.html#!/ | ||
| # AMRIT - ECD Service | ||
| [](https://www.gnu.org/licenses/gpl-3.0)  | ||
| ECD (Fast Healthcare Interoperability Resources) standard defines how healthcare information can be exchanged between different computer systems regardless of how it is stored in those systems. ECD provides a means for representing and sharing information among clinicians and organizations in a standard way regardless of the ways local EHRs represent or store the data. ECD combines the best features of previous standards into a common specification, while being flexible enough to meet needs of a wide variety of use cases within the healthcare ecosystem. Resources are the basis for all exchangeable ECD content. Each resource includes a standard definition and human-readable descriptions about how to use the resource. Each resource also has a set of common and resource-specific metadata (attributes) to allow its use clearly and unambiguously. ECD Resources can store and/or exchange many types of clinical and administrative data. | ||
| In AMRIT, currently we have developed 9 resources out of 27 resources. Contributors are working on developing rest of the 18 resources which will make AMRIT to be compliant with ABDM guidelines. ECD R4 is the latest version which we are migrating from HL7 V2.0 current version of AMRIT application. | ||
| ### Key APIs in ECD service | ||
| * Care Context Services | ||
| * e-Aushadhi | ||
| * ABHA Card Services | ||
| * OP Consultation Record Sharing | ||
| * Diagnostic Report Record Sharing | ||
| * Prescription Record Sharing | ||
| * Higher Health Facility | ||
| ## Environment and Setup | ||
| For setting up the development environment, please refer to the [Developer Guide](https://piramal-swasthya.gitbook.io/amrit/developer-guide/development-environment-setup) . | ||
| ## API Guide | ||
| Detailed information on API endpoints can be found in the [API Guide](https://piramal-swasthya.gitbook.io/amrit/architecture/api-guide). | ||
|
|
||
| ## Usage | ||
| All features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details. | ||
|
|
||
| ## Setting Up Commit Hooks | ||
|
|
||
| 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: | ||
|
|
||
| ### Prerequisites | ||
| - Node.js (v14 or later) | ||
| - npm (comes with Node.js) | ||
|
|
||
| ### Setup Steps | ||
|
|
||
| 1. **Install Node.js and npm** | ||
| - Download and install from [nodejs.org](https://nodejs.org/) | ||
| - Verify installation with: | ||
| ``` | ||
| node --version | ||
| npm --version | ||
| ``` | ||
| 2. **Install dependencies** | ||
| - From the project root directory, run: | ||
| ``` | ||
| npm ci | ||
| ``` | ||
| - This will install all required dependencies including Husky and commitlint | ||
| 3. **Verify hooks installation** | ||
| - The hooks should be automatically installed by Husky | ||
| - You can verify by checking if the `.husky` directory contains executable hooks | ||
| ### Commit Message Convention | ||
| This project follows a specific commit message format: | ||
| - Format: `type(scope): subject` | ||
| - Example: `feat(login): add remember me functionality` | ||
| Types include: | ||
| - `feat`: A new feature | ||
| - `fix`: A bug fix | ||
| - `docs`: Documentation changes | ||
| - `style`: Code style changes (formatting, etc.) | ||
| - `refactor`: Code changes that neither fix bugs nor add features | ||
| - `perf`: Performance improvements | ||
| - `test`: Adding or fixing tests | ||
| - `build`: Changes to build process or tools | ||
| - `ci`: Changes to CI configuration | ||
| - `chore`: Other changes (e.g., maintenance tasks, dependencies) | ||
| Your commit messages will be automatically validated when you commit, ensuring project consistency. | ||
| ## Filing Issues | ||
|
|
||
| If you encounter any issues, bugs, or have feature requests, please file them in the [main AMRIT repository](https://github.com/PSMRI/AMRIT/issues). Centralizing all feedback helps us streamline improvements and address concerns efficiently. | ||
|
|
||
| If you encounter any issues, bugs, or have feature requests, please file them in the [main AMRIT repository](https://github.com/PSMRI/AMRIT/issues). Centralizing all feedback helps us streamline improvements and address concerns efficiently. | ||
| ## Join Our Community | ||
|
|
||
| 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. | ||
|
|
||
| ## Usage | ||
|
|
||
| All the features of the ECD module have been exposed as REST endpoints. For detailed information on how to use the service, refer to the SWAGGER API specification. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| With the ECD module, you can efficiently manage all aspects of your telemedicine application, ensuring seamless remote healthcare services for patients and collaboration among healthcare professionals. | ||
|
|
||
| Expand Down | ||
|
|
||
|
|
||
|
|
||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| module.exports = { | ||
| 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], | ||
| 'scope-case': [2, 'always', 'lower-case'], | ||
| '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', | ||
| 'wip' | ||
| ], | ||
| ], | ||
| 'scope-enum': [ | ||
| 2, | ||
| 'always', | ||
| ['api', 'core', 'docs', 'config', 'git-hooks'] // Added git-hooks scope | ||
| ] | ||
| }, | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the
npxinvocation in the commit-msg hook.The current
npx --no -- commitlint --edit $1may not behave as intended. Use the recommended Husky pattern with a shebang, source Husky, and invoke Commitlint without the invalid--noflag:π Committable suggestion