Skip to content

Conversation

@ab-10
Copy link
Contributor

@ab-10 ab-10 commented Jul 18, 2025

Description

This PR adds custom Recurse ML rules to enforce best practices. Most of them (outside of effective_comments.mdc) are rust-specific.

Summary

effective_comments.mdc

Scope: all code
Purpose: Ensures comments add value by explaining why rather than what

Key principles:

  • Avoid redundant comments that restate obvious code
  • Use comments to clarify intent behind complex logic
  • Keep TODO comments specific with assignees
  • Always update comments when code changes

exhaustive_pattern_matching.mdc

Scope: Rust code
Purpose: Promotes safe enum handling through exhaustive pattern matching

Key principles:

  • Use match instead of nested if-else chains for enums
  • Handle all variants explicitly to prevent runtime panics
  • Use match guards for conditional patterns
  • Essential for Robyn's HTTP methods, response types, and middleware handling

proper_error_handling.mdc

Scope: Rust code
Purpose: Ensures robust error handling in the Python-Rust bridge

Key principles:

  • Never use unwrap() in production without justification
  • Use ? operator for error propagation
  • Handle PyO3 integration errors gracefully
  • Critical for preventing web server crashes and maintaining stability

PR Checklist

Please ensure that:

  • The PR contains a descriptive title
  • The PR contains a descriptive summary of the changes
  • N/A: You build and test your changes before submitting a PR.
  • You have added relevant documentation
  • N/A: You have added relevant tests. We prefer integration tests wherever possible

Pre-Commit Instructions:

@vercel
Copy link

vercel bot commented Jul 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
robyn ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2025 2:02pm

@recurseml
Copy link

recurseml bot commented Jul 18, 2025

✨ No files to analyze in this PR.

Need help? Join our Discord for support!
https://discord.gg/qEjHQk64Z9

@sansyrox
Copy link
Member

Hey @ab-10 ,

Thanks for the PR. Could you please fetch the latest changes? The PR is failing for some reason.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 20, 2025

CodSpeed Performance Report

Merging #1214 will not alter performance

Comparing Recurse-ML:main (9bcc98c) with main (40afefe)1

Summary

✅ 150 untouched benchmarks

Footnotes

  1. No successful run was found on main (fff99fe) during the generation of this report, so 40afefe was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Member

@sansyrox sansyrox left a comment

Choose a reason for hiding this comment

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

LGTM!

@sansyrox sansyrox merged commit c82be70 into sparckles:main Aug 30, 2025
54 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