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

Move ast-grep documentation under the prompt-customization page #24

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

petrisorcoderabbit
Copy link
Contributor

@petrisorcoderabbit petrisorcoderabbit commented Mar 13, 2024

Summary by CodeRabbit

  • Documentation
    • Enhanced instructions for custom code review with AST-Grep rules, including rule creation, application, categorization, and multi-language support.
  • Chores
    • Removed the "ast-grep" item from the Integrations category in the documentation sidebar.

Copy link
Contributor

coderabbitai bot commented Mar 13, 2024

Walkthrough

Walkthrough

The recent update introduces comprehensive guidance on leveraging AST-Grep rules for enhanced code review processes. This includes the creation, application, and categorization of these rules into atomic, relational, and composite types, along with the inclusion of utility rules. It also expands on supporting multiple programming languages. Additionally, the update streamlines the navigation by removing the "ast-grep" entry from the "Integrations" category in the sidebar configuration, simplifying access to other tools.

Changes

File Path Change Summary
docs/.../prompt-customization.md Introduced instructions for using AST-Grep rules for code review, including creation, application, and categorization of rules, as well as multiple language support.
sidebars.ts Removed "ast-grep" item from the "Integrations" category, leaving "self-hosted-gitlab".

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.

Copy link

netlify bot commented Mar 13, 2024

Deploy Preview for reliable-buttercream-0e11cf ready!

Name Link
🔨 Latest commit e1e9e85
🔍 Latest deploy log https://app.netlify.com/sites/reliable-buttercream-0e11cf/deploys/65f20c3f12c0a60008c3fb91
😎 Deploy Preview https://deploy-preview-24--reliable-buttercream-0e11cf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e1e9e85
Status: ✅  Deploy successful!
Preview URL: https://d77d41dc.coderabbit-docs.pages.dev
Branch Preview URL: https://ast-grep-update.coderabbit-docs.pages.dev

View logs

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 7ea5ac9 and 58731af.
Files selected for processing (2)
  • docs/guides/prompt-customization.md (1 hunks)
  • sidebars.ts (1 hunks)
Additional comments: 8
sidebars.ts (1)
  • 43-43: The removal of the "ast-grep" item from the "Integrations" category in sidebars.ts is correctly implemented. The syntax and structure of the file remain intact, aligning with the PR's objectives to reorganize the documentation.
docs/guides/prompt-customization.md (7)
  • 48-314: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

The front matter of the markdown file seems to be correctly formatted. However, the static analysis hinted at an unpaired symbol, which appears to be a false positive in this context. The metadata is correctly enclosed in triple dashes (---), and the quotation marks are properly paired.

  • 52-60: The introduction to AST instructions is clear and provides a good overview of what AST-Grep is and how it can be used for custom code review instructions. This section effectively sets the stage for the detailed instructions that follow.
  • 62-78: The steps for adding AST-Grep rules are clearly outlined and easy to follow. However, there are minor typographical issues flagged by the static analysis, such as possible spelling mistakes with "ast-grep" and repeated whitespaces. These are not actual issues in the context of this documentation, as "ast-grep" is correctly used, and the whitespace issues are within code blocks or markdown syntax, where they do not impact readability or functionality.
  • 79-114: The explanation of the rule object and the categorization into atomic, relational, and composite rules are well-structured and informative. The comparison to CSS selectors to help understand the rule object is a nice touch. However, the static analysis flagged potential grammatical issues and possible spelling mistakes, which seem to be false positives in this technical context. The documentation is clear and does not require corrections in these areas.
  • 116-172: The detailed breakdown of atomic, relational, and composite rules, including examples, is very helpful for understanding how to create and apply AST-Grep rules. The static analysis flagged some duplicated phrases and possible spelling mistakes, but these are either intentional for emphasis or false positives due to the technical nature of the content. The documentation maintains clarity and correctness throughout.
  • 174-235: The section on reusing rules as utility and the distinction between local and global utility rules is insightful. It addresses potential limitations and provides clear examples for creating and applying utility rules. The static analysis flagged potential spelling mistakes and issues with capitalization, but these do not detract from the overall quality and clarity of the documentation.
  • 237-272: The documentation on multiple languages support and examples of AST-Grep rules in different languages is a valuable addition, showcasing the tool's versatility. The static analysis flagged potential spelling mistakes and issues with capitalization, but these are either false positives or minor issues that do not impact the clarity or correctness of the documentation.

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: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 58731af and e1f7366.
Files selected for processing (1)
  • docs/guides/prompt-customization.md (1 hunks)
Additional comments: 6
docs/guides/prompt-customization.md (6)
  • 52-68: The introduction to AST instructions and the steps to add ast-grep rules are clear and well-structured. However, consider adding a brief explanation or example of what an AST pattern looks like to provide immediate context for readers unfamiliar with AST or ast-grep.
  • 79-114: The explanation of the rule object and the three categories of rules (Atomic, Relational, Composite) is comprehensive. It might be beneficial to include a simple, practical example of how these rules can be applied in a real-world scenario to help readers better understand their utility.
  • 174-218: The section on reusing rules as utility and the distinction between local and global utility rules is informative. To enhance clarity, consider adding a note on why one might choose local over global utility rules (or vice versa) based on different use cases.
  • 237-272: The documentation on multiple languages support and examples of ast-grep rules in different languages is a valuable addition. It would be helpful to include a brief note on any limitations or considerations when defining rules for languages with significant syntactical differences.
  • 48-314: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

The metadata at the beginning of the file seems to be correctly formatted. However, the static analysis hint about an unpaired symbol might be a false positive, as the syntax appears correct for YAML front matter in Markdown. No action is needed here.

  • 55-60: The spelling mistakes flagged by the static analysis tool in lines related to "ast-grep" and "wikipedia" are false positives, as these are proper nouns and technical terms. No correction is needed.

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: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e1f7366 and e1e9e85.
Files selected for processing (1)
  • docs/guides/prompt-customization.md (1 hunks)
Additional comments: 6
docs/guides/prompt-customization.md (6)
  • 48-314: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

The metadata section at the beginning of the file seems to be correctly formatted, but the static analysis hinted at an unpaired symbol. This is likely a false positive, as the quotation marks appear to be correctly paired in the provided context.

  • 62-68: The steps for adding AST-Grep rules are clearly outlined and easy to follow. However, ensure that the .coderabbit.yml file and the folder structure mentioned are consistent with the project's actual configuration files and directories. This is crucial for users to correctly implement the instructions.
  • 79-114: The explanation of the rule object and the three categories of rules (Atomic, Relational, Composite) is comprehensive and informative. It's beneficial for users to understand how to construct their AST-Grep rules effectively. Consider adding examples or links to examples for each rule type to enhance understanding further.

Consider adding practical examples or links to examples for each rule type (Atomic, Relational, Composite) to enhance user understanding.

  • 136-171: The Composite rule section is clear and provides a good explanation of how composite rules work. Including examples for each type of composite rule (all, any, not) is helpful for users to understand their application. No issues found here.
  • 174-207: The section on reusing rules as utility and the distinction between local and global utility rules is insightful. It's important for users to understand how to efficiently manage and reuse rules across their projects. Ensure that the project structure and .coderabbit.yml configuration mentioned are accurate and consistent with the actual project setup.
  • 237-272: The section on multiple languages support and examples of AST-Grep rules in different languages is a valuable addition, showcasing the tool's versatility. Ensure that the examples provided are accurate and tested across the mentioned programming languages for correctness.

@guritfaq guritfaq merged commit 4af4967 into master Mar 13, 2024
5 checks passed
@petrisorcoderabbit petrisorcoderabbit deleted the ast_grep_update branch March 13, 2024 21:12
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.

3 participants