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

Prettier Integration #154

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

Bashamega
Copy link
Member

@Bashamega Bashamega commented Aug 2, 2024

Fixes Issue

closes #153

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • [] My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

Summary by CodeRabbit

  • Documentation

    • Improved clarity of the issue template in GitHub by adjusting the formatting and description fields.
    • Enhanced the readability of the CHANGELOG.md file by removing extraneous line breaks.
    • Made formatting adjustments to the README.md tables for better alignment.
  • Chores

    • Introduced commands for formatting checks and writing in the pre-commit hook for better code quality.
    • Added Prettier configuration to standardize code formatting across the project.
    • Updated the version number in the app.json configuration file.
  • Style

    • Consistently applied trailing commas and improved formatting in several JavaScript files to enhance code readability.

Copy link
Contributor

coderabbitai bot commented Aug 2, 2024

Walkthrough

This update integrates Prettier for code formatting across the project, enhancing consistency and readability. Key changes include the addition of Prettier configuration, corresponding scripts in package.json, and formatting adjustments across various files to align with the new rules. These modifications streamline the codebase and improve its maintainability.

Changes

Files Change Summary
.github/ISSUE_TEMPLATE/bug.yml Improved formatting for clarity in the issue template.
.husky/pre-commit Added formatting check command; integrated potential test command for future use.
.prettierrc Created configuration file for Prettier with specific formatting rules (tabWidth, useTabs).
CHANGELOG.md Streamlined formatting for clarity in version entries.
README.md Adjusted table formatting for better readability.
package.json Added scripts for Prettier formatting and included Prettier as a dependency.
src/** (multiple files) Minor formatting adjustments (trailing commas) for consistency; no changes in logic.
src/config/app.json Added newline for formatting; no other content changes.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Prettier
    participant CI/CD
    Developer->>Prettier: Format code
    alt If code is formatted correctly
        Prettier-->>Developer: Code is clean
    else If code needs changes
        Prettier-->>Developer: Suggest changes
    end
    Developer->>CI/CD: Commit changes
    CI/CD->>Prettier: Run pre-commit hook
    Prettier-->>CI/CD: Ensure code format compliance
Loading

Assessment against linked issues

Objective Addressed Explanation
Integrate Prettier for code formatting
Add Prettier to pre-commit hooks
Ensure code is formatted consistently

Poem

🐰 In the land where code does hop,
Prettier came to make it stop,
With tidy lines and spaces bright,
Our code now gleams with pure delight!
Linting, checking, all in place,
A formatted world, a joyful space! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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 Configuration 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
Contributor

@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: 4

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 42cb42a and b480796.

Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing (21)
  • .github/ISSUE_TEMPLATE/bug.yml (1 hunks)
  • .husky/pre-commit (1 hunks)
  • .prettierrc (1 hunks)
  • CHANGELOG.md (1 hunks)
  • README.md (2 hunks)
  • package.json (2 hunks)
  • postcss.config.js (1 hunks)
  • src/app/api/activity/route.js (2 hunks)
  • src/app/api/badge/route.js (2 hunks)
  • src/app/api/leaderboard/route.js (1 hunks)
  • src/app/api/popular/route.js (1 hunks)
  • src/app/api/rate/route.js (8 hunks)
  • src/app/api/repos/route.js (1 hunks)
  • src/app/api/stats/route.js (1 hunks)
  • src/app/layout.js (1 hunks)
  • src/app/rankings/page.js (1 hunks)
  • src/app/rate/Form.js (1 hunks)
  • src/components/Repos.js (2 hunks)
  • src/components/SideNav.js (3 hunks)
  • src/components/Users.js (1 hunks)
  • src/config/app.json (1 hunks)
Files skipped from review due to trivial changes (19)
  • .github/ISSUE_TEMPLATE/bug.yml
  • .husky/pre-commit
  • .prettierrc
  • README.md
  • postcss.config.js
  • src/app/api/activity/route.js
  • src/app/api/badge/route.js
  • src/app/api/leaderboard/route.js
  • src/app/api/popular/route.js
  • src/app/api/rate/route.js
  • src/app/api/repos/route.js
  • src/app/api/stats/route.js
  • src/app/layout.js
  • src/app/rankings/page.js
  • src/app/rate/Form.js
  • src/components/Repos.js
  • src/components/SideNav.js
  • src/components/Users.js
  • src/config/app.json
Additional context used
LanguageTool
CHANGELOG.md

[grammar] ~5-~5: The proper noun “Chrome” (= software from Google) needs to be capitalized.
Context: .....v0.6.0) (2024-08-01) ### Features - chrome extension button ([#148](https://github...

(GOOGLE_PRODUCTS)

Markdownlint
CHANGELOG.md

15-15: Expected: h2; Actual: h3
Heading levels should only increment by one level at a time

(MD001, heading-increment)


21-21: Expected: h2; Actual: h3
Heading levels should only increment by one level at a time

(MD001, heading-increment)

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

10-10: LGTM!

The prepare script command is correctly set to husky, which is useful for managing Git hooks.


11-11: LGTM!

The format:write script command is correctly set to prettier . --write, which formats the entire codebase.


12-12: LGTM!

The format:check script command is correctly set to prettier . --check, which checks the formatting of the entire codebase without making changes.


36-36: LGTM!

The prettier dependency is correctly added with version 3.3.3.

CHANGELOG.md (2)

17-17: Fix heading level.

The heading level should only increment by one level at a time.

- ### Features
+ ## Features

Likely invalid or redundant comment.


23-23: Fix heading level.

The heading level should only increment by one level at a time.

- ### Features
+ ## Features

Likely invalid or redundant comment.

CHANGELOG.md Outdated
* badges ([#149](https://github.com/EddieHubCommunity/RepoRater/issues/149)) ([88c2bac](https://github.com/EddieHubCommunity/RepoRater/commit/88c2bac75352d5002865c2a08ddeac5601968264))


- badges ([#149](https://github.com/EddieHubCommunity/RepoRater/issues/149)) ([88c2bac](https://github.com/EddieHubCommunity/RepoRater/commit/88c2bac75352d5002865c2a08ddeac5601968264))
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix heading level.

The heading level should only increment by one level at a time.

- ### Bug Fixes
+ ## Bug Fixes

Committable suggestion was skipped due to low confidence.

CHANGELOG.md Outdated
* chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))


- chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix heading level.

The heading level should only increment by one level at a time.

- ### Features
+ ## Features
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
## Features
- chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
Tools
LanguageTool

[grammar] ~5-~5: The proper noun “Chrome” (= software from Google) needs to be capitalized.
Context: .....v0.6.0) (2024-08-01) ### Features - chrome extension button ([#148](https://github...

(GOOGLE_PRODUCTS)


Capitalize "Chrome".

The proper noun "Chrome" should be capitalized.

- chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
+ Chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
- chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
+ Chrome extension button ([#148](https://github.com/EddieHubCommunity/RepoRater/issues/148)) ([39129bd](https://github.com/EddieHubCommunity/RepoRater/commit/39129bd0e80a829a248fb3eee3ed032d8d10f482))
Tools
LanguageTool

[grammar] ~5-~5: The proper noun “Chrome” (= software from Google) needs to be capitalized.
Context: .....v0.6.0) (2024-08-01) ### Features - chrome extension button ([#148](https://github...

(GOOGLE_PRODUCTS)

CHANGELOG.md Outdated



- deployment app name ([e5fa00a](https://github.com/EddieHubCommunity/RepoRater/commit/e5fa00ae4d408141f4a81304e16e796fa998b0fa))
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix heading level.

The heading level should only increment by one level at a time.

- ### Bug Fixes
+ ## Bug Fixes

Committable suggestion was skipped due to low confidence.

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

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

This looks great 👍

Please can we exclude the file CHANGELOG.md to avoid conflicts as this is autogenerated

Copy link
Contributor

@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 b480796 and d3ba398.

Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing (2)
  • package.json (2 hunks)
  • src/config/app.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/config/app.json
Additional comments not posted (2)
package.json (2)

11-12: Well-integrated Prettier scripts.

The addition of format:write and format:check scripts effectively automates code formatting tasks using Prettier.


36-36: Correctly added Prettier dependency.

Adding Prettier to devDependencies ensures it's available for development tasks without affecting production dependencies.

ghost

This comment was marked as off-topic.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM

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.

[BUG] Integrate prettier
2 participants