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: added commitlint #222

Merged
merged 14 commits into from
Jun 26, 2024
Merged

feat: added commitlint #222

merged 14 commits into from
Jun 26, 2024

Conversation

biratdatta
Copy link
Collaborator

@biratdatta biratdatta commented Jun 22, 2024

image

Summary by CodeRabbit

  • Chores

    • Integrated commit message linting to enforce consistent commit messages.
  • Refactor

    • Improved the structure and styling of image elements in the Navbar component.

Copy link

coderabbitai bot commented Jun 26, 2024

Walkthrough

The recent changes introduce several enhancements to the codebase, primarily focusing on commit message linting and pre-commit build processes. New configuration files for commitlint and husky hooks ensure commit message standards and code quality. There's also an update to the Navbar component, importing the Image component from next/image with some JSX restructuring.

Changes

File Change Summary
.husky/commit-msg Added a shell script for commit message linting using npx commitlint --edit.
.husky/pre-commit Extended script to run npm run build along with npx lint-staged.
commitlint.config.js Introduced configuration for commit message types extending conventional commit rules.
package.json Added commit-msg hook configuration and new dev dependencies for commitlint and config-conventional.
src/components/message-item/... Removed a redundant line; no functional changes.
src/components/navbar/index.tsx Imported Image from 'next/image' and adjusted JSX structure and styling.

Sequence Diagram(s)

No sequence diagrams are necessary for these changes.

Poem

Change and lint, a code’s delight,
Building strong, from morn till night.
Navbar's trim and image grand,
Commit messages so well-planned.
Code enhanced, a joyful spree,
In our repo, harmony!


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e7c0d41 and 7290b76.

Files selected for processing (6)
  • .husky/commit-msg (1 hunks)
  • .husky/pre-commit (1 hunks)
  • commitlint.config.js (1 hunks)
  • package.json (2 hunks)
  • src/components/message-item/index.tsx (1 hunks)
  • src/components/navbar/index.tsx (2 hunks)
Files skipped from review due to trivial changes (3)
  • .husky/commit-msg
  • .husky/pre-commit
  • commitlint.config.js
Additional context used
Biome
src/components/navbar/index.tsx

[error] 223-223: Expected an identifier but instead found '<'. (parse)

Expected an identifier here.


[error] 223-223: expected , but instead found data (parse)

Remove data


[error] 223-223: expected , but instead found - (parse)

Remove -


[error] 223-223: expected , but instead found testid (parse)

Remove testid


[error] 223-223: expected , but instead found = (parse)

Remove =


[error] 224-224: expected ... but instead found showRightLogo1 (parse)

Remove showRightLogo1


[error] 231-231: expected ... but instead found showRightLogo2 (parse)

Remove showRightLogo2


[error] 238-238: expected ... but instead found showRightLogo3 (parse)

Remove showRightLogo3


[error] 245-245: expected > but instead found < (parse)

Remove <

src/components/message-item/index.tsx

[error] 619-641: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.


[error] 679-692: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.


[error] 713-726: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.


[error] 763-804: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.


[error] 946-953: Provide a title attribute when using iframe elements. (lint/a11y/useIframeTitle)

Screen readers rely on the title set on an iframe to describe the content being displayed.


[error] 1112-1153: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.


[error] 148-148: Don't use 'Boolean' as a type. (lint/complexity/noBannedTypes)

Use lowercase primitives for consistency.
Safe fix: Use 'boolean' instead


[error] 598-603: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

Additional comments not posted (4)
package.json (2)

15-19: Ensure proper configuration of Husky hooks for commit messages.

The Husky configuration for commit-msg uses commitlint -E HUSKY_GIT_PARAMS. This setup is appropriate for ensuring that commit messages adhere to the configured standards.


71-72: Correct addition of commitlint dependencies.

The devDependencies have been correctly updated to include @commitlint/cli and @commitlint/config-conventional. This supports the commit message linting functionality.

src/components/navbar/index.tsx (1)

18-18: Validate the import of Image component.

The import of Image from 'next/image' is appropriate here, as it is used later in the JSX. Ensure that this import does not conflict with any global Image objects.

src/components/message-item/index.tsx (1)

1217-1217: Validate removal of redundant code.

The removal of the redundant line in src/components/message-item/index.tsx seems appropriate and does not affect the functionality of the component.

Comment on lines 222 to 245
<
<div data-testid="navbar-right-logos">
{showRightLogo1 && (
<img
src={rightLogo1Src}
alt={`Right Logo 1`}
style={{ maxHeight: '60px' }}
/>
)}
{showRightLogo2 && (
<img
src={rightLogo2Src}
alt={`Right Logo 2`}
style={{ maxHeight: '60px' }}
/>
)}
{showRightLogo3 && (
<img
src={rightLogo3Src}
alt={`Right Logo 3`}
style={{ maxHeight: '60px' }}
/>
)}
</div>
Copy link

Choose a reason for hiding this comment

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

Syntax error in JSX structure.

There appears to be a syntax error near line 222, where a stray '<' character is found. This needs to be corrected to ensure proper rendering of the component.

-                    <
+                    // Corrected stray character

Committable suggestion was skipped due to low confidence.

Tools
Biome

[error] 223-223: Expected an identifier but instead found '<'. (parse)

Expected an identifier here.


[error] 223-223: expected , but instead found data (parse)

Remove data


[error] 223-223: expected , but instead found - (parse)

Remove -


[error] 223-223: expected , but instead found testid (parse)

Remove testid


[error] 223-223: expected , but instead found = (parse)

Remove =


[error] 224-224: expected ... but instead found showRightLogo1 (parse)

Remove showRightLogo1


[error] 231-231: expected ... but instead found showRightLogo2 (parse)

Remove showRightLogo2


[error] 238-238: expected ... but instead found showRightLogo3 (parse)

Remove showRightLogo3


[error] 245-245: expected > but instead found < (parse)

Remove <

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7290b76 and 8998c35.

Files selected for processing (1)
  • src/components/navbar/index.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
  • src/components/navbar/index.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8998c35 and c05495d.

Files selected for processing (1)
  • src/components/navbar/index.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/components/navbar/index.tsx

@prtkjakhar prtkjakhar merged commit 9b9383d into dev Jun 26, 2024
@prtkjakhar prtkjakhar deleted the feat/newpipeline branch June 26, 2024 11:09
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.

2 participants