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

fix: handle commit message starting with # #59

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

aj3sh
Copy link
Member

@aj3sh aj3sh commented Jul 18, 2024

Description

Handled commit message starting with '#'.

How was the issue fixed?

Comments are removed only on the file as a commit source (--file), as comments are only allowed through the file from git. This fix resolved the issue on GitHub Actions, CLI which uses hash values and direct commit messages.

For the file as a commit source, the linter will still remove the comments, including valid commits starting with '#'. A commit message starting with '#' will be treated as an empty commit. Since a commit starting with '#' does not follow the conventional commit specification, treating it as an empty commit yields the same result. Additionally, we display the full commit message in the input section, therefore the commit message will not be empty in this case.

Furthermore, the README document is updated mentioning not to use the commit messages that start with '#'.

Development Summary

  • Removed comments only on --file (since the commit message from hash doesn't contain comments). This improves performance.
  • Displayed full commit on 'Input' section of output.
  • Created function remove_diff_from_commit_message for removing diff from the commits.
  • Updated README doc for not using commit messages that start with '#'.
  • Allowed codecov checks for coverage.

Related Issue

Fixes #49

Type of Change

Please mark the appropriate option below to describe the type of change your pull request introduces:

  • Bug fix
  • New feature
  • Enhancement
  • Documentation update
  • Refactor
  • Other (please specify)

Checklist

  • My pull request has a clear title and description.
  • I have used semantic commit messages.
    Examples: "fix: Fixed foobar bug", "feat(accounts): Added foobar feature".
  • I have added/updated the necessary documentation on README.md.
  • I have added appropriate test cases (if applicable) to ensure the changes are functioning correctly.

Additional Notes

[Add any additional notes or context that you think the reviewers should know about.]

By submitting this pull request, I confirm that I have read and complied with the contribution guidelines of this project.

- Removed comments only on `--file` (since the commit message from hash doesn't contain comments). This improves performance.
- Displayed full commit on 'Input' section of output.
- Created function `remove_diff_from_commit_message` for removing diff from the commits.
- Updated README doc for not using commit messages that start with '#'.
- Allowed codecov checks for coverage.
@aj3sh aj3sh requested review from sugat009 and subashcs and removed request for sugat009 July 18, 2024 15:15
@aj3sh aj3sh marked this pull request as ready for review July 18, 2024 15:15
@aj3sh aj3sh merged commit ea7683f into opensource-nepal:main Jul 24, 2024
3 checks passed
@aj3sh aj3sh deleted the hash-commits branch July 24, 2024 10:02
@github-actions github-actions bot mentioned this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Commit message starting with # is displayed as an empty commit
2 participants