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

chore: add a language support guide #49

Merged
merged 5 commits into from
Mar 21, 2024
Merged

chore: add a language support guide #49

merged 5 commits into from
Mar 21, 2024

Conversation

morgante
Copy link
Contributor

@morgante morgante commented Mar 21, 2024

Open source instructions for adding languages

Summary by CodeRabbit

  • Documentation
    • Updated the contributing guide with instructions on handling feature flags, adjusting language grammars, snippet contexts, and adding new target languages in Grit.
    • Provided guidance on debugging and regenerating grammars.

Copy link
Contributor

coderabbitai bot commented Mar 21, 2024

Warning

Rate Limit Exceeded

@morgante has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 54 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between a81b35e and 112bfa6.

Walkthrough

The diff introduces changes related to feature flags for code compilation, adjustments to language grammars, snippet contexts, and the process of adding a new target language in Grit. It provides guidance on debugging grammars, regenerating matching grammars, and adding new target languages. Additionally, it outlines internal steps not required for contributors.

Changes

Files Change Summary
CONTRIBUTING.md Guidelines updated for feature flags, language grammars, snippet contexts, and adding languages. Includes debugging and internal steps.

🐇✨
In the realm of code, where Grit does abide,
A rabbit hopped through, with changes to guide.
Flags, grammars, and languages, oh my!
With every leap forward, our code does comply.
So here's to the changes, both big and small,
May our coding journey continue, enthralled.
🌟📚

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-tests 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 tests 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 tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@morgante morgante mentioned this pull request Mar 21, 2024
@morgante morgante requested a review from a team March 21, 2024 19:30
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 8ea5b3f and e0e9064.
Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)
Additional comments: 5
CONTRIBUTING.md (5)
  • 14-20: The explanation of feature flags is clear and informative. However, it might be beneficial to provide an example of how to enable a feature flag for new contributors who might not be familiar with the process.

Consider adding a brief example or code snippet demonstrating how to enable a feature flag, such as the grit_alpha or grit_beta flag, to make this section more accessible to newcomers.

  • 29-29: The link provided to the "Tips and Tricks for a grammar author" guide is a valuable resource. However, it's essential to ensure that all external links are up-to-date and accessible.
Verification successful

The link to the "Tips and Tricks for a grammar author" guide is accessible and returns a 200 HTTP status code, confirming its availability. Therefore, the external link provided in the CONTRIBUTING.md file is up-to-date and accessible.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the accessibility of the external link.
curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://github.com/tree-sitter/tree-sitter/wiki/Tips-and-Tricks-for-a-grammar-author | grep 200

Length of output: 164

* 35-37: The explanation of snippet contexts is insightful, especially the SQL example provided. However, the description could be enhanced by explaining why snippet contexts are necessary and how they improve the matching process.

Consider expanding the explanation of snippet contexts to include more about their importance and impact on the matching process, potentially with more examples from different languages.

  • 48-58: The steps for adding a new target language are well-structured and seem comprehensive. However, it's crucial to ensure that each step is clear and actionable, especially for contributors who might be new to the project or to language support in general.

Review the steps for clarity and actionability. Ensure that each step is described in sufficient detail for someone unfamiliar with the project to follow. It might also be helpful to link to additional resources or examples for complex steps.

  • 59-70: The section on internal steps not required for contributors is a thoughtful inclusion, helping to clarify the scope of what contributors need to focus on. However, it's important to ensure that this distinction is clear and that contributors understand which parts of the process they are responsible for.

Consider adding a brief introductory sentence to this section to reiterate that these steps are handled internally and are not required for contributors. This can help prevent any confusion and ensure that contributors focus on the correct aspects of adding language support.

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.

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e0e9064 and a81b35e.
Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)
Additional comments: 2
CONTRIBUTING.md (2)
  • 37-37: There seems to be an unpaired symbol in the documentation.

Ensure that all symbols are correctly paired for clarity. If this is a formatting issue related to markdown or the display of code snippets, please disregard this comment.

  • 69-69: There's an unpaired symbol in the documentation.

Ensure that all symbols are correctly paired for clarity. If this is a formatting issue related to markdown or the display of code snippets, please disregard this comment.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
morgante and others added 3 commits March 21, 2024 15:36
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@morgante morgante merged commit c8f9160 into main Mar 21, 2024
6 checks passed
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