Skip to content
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

feat: initial commitlint configuration ✨ #920

Merged
merged 12 commits into from
Jul 24, 2023
Merged

feat: initial commitlint configuration ✨ #920

merged 12 commits into from
Jul 24, 2023

Conversation

Nishitbaria
Copy link
Contributor

@Nishitbaria Nishitbaria commented Jul 23, 2023

Related Issues:
Closes #898

Description:

This pull request introduces the integration of Commitlint into the project. Commitlint is a powerful tool that enforces a standardized format for commit messages, ensuring consistency and clarity across all contributions. By adhering to a common commit message convention, we can enhance collaboration, simplify code review processes, and facilitate better changelog generation.

Sure! To add instructions for committing using commitlint, you can include the following guidelines along with examples of valid and invalid commit messages.

Commit Message Guidelines using Commitlint

We follow a standardized commit message format using Commitlint to ensure consistency and clarity in our commit history. Each commit message should adhere to the following guidelines:

  1. Type: The commit type must be one of the following:

    • feat: A new feature or enhancement.
    • fix: A bug fix.
    • docs: Documentation changes.
    • style: Code style changes (e.g., formatting, semicolons).
    • refactor: Code refactorings with no feature changes or bug fixes.
    • test: Adding or improving tests.
    • chore: General maintenance tasks, build changes, etc.
  2. Scope (Optional): The scope provides context for the commit, indicating the specific part of the project being affected. Use a short description in lowercase (e.g., auth, navbar, README).

  3. Description: A brief and meaningful description of the changes made. Start with a capital letter and use the imperative mood (e.g., "Add new feature" instead of "Added new feature").

  4. Issue reference (Optional): Include the issue number associated with the commit (e.g., #123).

Examples:

Valid Commit Messages:

  • feat: Add user authentication feature
  • fix(auth): Resolve login page redirect issue
  • docs: Update installation instructions
  • style: Format code according to project guidelines
  • refactor(navbar): Improve responsiveness
  • test: Add unit tests for API endpoints
  • chore: Update dependencies to latest versions
  • fix: Handle edge case in data processing (#456)

Invalid Commit Messages:

  • Added new stuff
  • Fixed a bug
  • Updated code
  • auth feature update
  • chore: fixed some stuff

Commit Example with Commitlint:

git commit -m "feat(auth): Implement user signup process (#789)"

Remember to run commitlint before pushing your changes to ensure your commit messages meet the guidelines.

By following these guidelines, we can maintain a clean commit history that is easy to understand and helps us effectively track changes. If you have any questions or need further assistance, feel free to ask! Happy contributing!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you Nishitbaria! for creating this pull request and contributing to Dummygram! 💗

The maintainers will review this Pull Request and provide feedback as soon as possible! 😇
We appreciate your patience and contribution, Keep up the great work! 😀

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi there Nishitbaria!, congratulations on your first pull request :)

@Nishitbaria
Copy link
Contributor Author

Related Issues: Closes #898

Description:

This pull request introduces the integration of Commitlint into the project. Commitlint is a powerful tool that enforces a standardized format for commit messages, ensuring consistency and clarity across all contributions. By adhering to a common commit message convention, we can enhance collaboration, simplify code review processes, and facilitate better changelog generation.

Changes:

  • Added the necessary Commitlint configuration files.
  • Set up commit message rules to enforce the conventional commit format.
  • Updated the project's contributing guidelines to include Commitlint usage.

Testing: To ensure that Commitlint is functioning correctly, we have conducted extensive testing on this implementation. We have created test commits with various scenarios, including valid and invalid commit messages, to verify that the commit message rules are being enforced accurately. All tests have successfully passed, demonstrating the effectiveness of Commitlint in maintaining commit message consistency.

How to Verify:

  1. Clone this branch and run the project locally.
  2. Make a test commit with a valid commit message format.
  3. Make another test commit with an invalid commit message format (non-compliant with the conventional commit format).
  4. Observe the output of Commitlint during the commit process and verify that it accepts the valid message and rejects the invalid one.

Please review this pull request, and let me know if any further adjustments or improvements are required. Your feedback is highly appreciated, and together, we can ensure a more organized and collaborative development process. Thank you!

hey @narayan954 please review my Pr

@narayan954
Copy link
Owner

Related Issues: Closes #898

Description:

This pull request introduces the integration of Commitlint into the project. Commitlint is a powerful tool that enforces a standardized format for commit messages, ensuring consistency and clarity across all contributions. By adhering to a common commit message convention, we can enhance collaboration, simplify code review processes, and facilitate better changelog generation.

Changes:

  • Added the necessary Commitlint configuration files.
  • Set up commit message rules to enforce the conventional commit format.
  • Updated the project's contributing guidelines to include Commitlint usage.

Testing: To ensure that Commitlint is functioning correctly, we have conducted extensive testing on this implementation. We have created test commits with various scenarios, including valid and invalid commit messages, to verify that the commit message rules are being enforced accurately. All tests have successfully passed, demonstrating the effectiveness of Commitlint in maintaining commit message consistency.

How to Verify:

  1. Clone this branch and run the project locally.
  2. Make a test commit with a valid commit message format.
  3. Make another test commit with an invalid commit message format (non-compliant with the conventional commit format).
  4. Observe the output of Commitlint during the commit process and verify that it accepts the valid message and rejects the invalid one.

Please review this pull request, and let me know if any further adjustments or improvements are required. Your feedback is highly appreciated, and together, we can ensure a more organized and collaborative development process. Thank you!

hey @narayan954 please review my Pr

Hi @Nishitbaria I can't verify it with instruction you provided. Can you check again? Also, I am not sure if that's because my commit message was a valid one. You haven't described valid/invalid commit message this'd filter.
Ps: I did install the modules by npm i -f command

Also, you haven't updated the contribution guideline.

Can you please check these?

Attaching ss of my test attempt
image

@Nishitbaria
Copy link
Contributor Author

@narayan954 ,I am updating in few minutes

@Nishitbaria
Copy link
Contributor Author

Hey @narayan954 I have updated contribution. md and also added an example :

image

@narayan954
Copy link
Owner

Hey @narayan954 I have updated contribution. md and also added an example :

Thanks a lot @Nishitbaria , can you help with this ?
image
Is this issue native to linux or you can confirm this on your system as well?
I was still able to easily commit with invalid commit message.

@narayan954
Copy link
Owner

narayan954 commented Jul 24, 2023

by running this command chmod ug+x .husky/* I was able to enable this, but if that'd be needed for every new setup, contributors won't simply follow that, do you happen to have a solution for this?

@Nishitbaria
Copy link
Contributor Author

Hey @narayan954, there's one thing you can do. Could you please delete your current clone and re-clone it? I have fixed the changes.

@narayan954
Copy link
Owner

Hey @narayan954, there's one thing you can do. Could you please delete your current clone and re-clone it? I have fixed the changes.

oh alright!

@narayan954
Copy link
Owner

Thank you! It works!!

Copy link
Owner

@narayan954 narayan954 left a comment

Choose a reason for hiding this comment

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

looks good to me!

@narayan954 narayan954 merged commit f5367aa into narayan954:master Jul 24, 2023
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Commit Lint, Husky, ESLint, and Prettier for Code Quality and Consistency
2 participants