-
Notifications
You must be signed in to change notification settings - Fork 3
cursor rules cli #116
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
cursor rules cli #116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added new CLI subcommand add-cursor-rules
to download and install Laminar cursor rules from a hardcoded GitHub URL.
- Downloads
laminar.mdc
from a hardcoded dev branch URL (https://raw.githubusercontent.com/lmnr-ai/lmnr/dev/rules/laminar.mdc
), which could be unstable - Missing validation of downloaded content before writing to disk
- Consider using
pathlib.Path.write_bytes()
instead of opening file in 'wb' mode for better error handling - Should verify HTTPS certificate when downloading from GitHub to prevent MITM attacks
- Consider adding a
--force
flag to control overwriting of existing files
1 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
def add_cursor_rules(args): | ||
"""Download laminar.mdc file from a hardcoded public URL and save it to .cursor/rules/laminar.mdc""" | ||
# Hardcoded URL for the laminar.mdc file | ||
url = "https://raw.githubusercontent.com/lmnr-ai/lmnr/dev/rules/laminar.mdc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: URL points to 'dev' branch which could be unstable. Consider using 'main' branch or making the branch configurable
src/lmnr/cli.py
Outdated
@@ -16,6 +19,39 @@ | |||
EVAL_DIR = "evals" | |||
|
|||
|
|||
def add_cursor_rules(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Function accepts args parameter but doesn't use it. Consider removing unused parameter
def add_cursor_rules(args): | |
def add_cursor_rules(): |
src/lmnr/cli.py
Outdated
parser_download = subparsers.add_parser( | ||
"add-cursor-rules", | ||
description="Download laminar.mdc file from a hardcoded public URL", | ||
help="Download laminar.mdc file from a hardcoded public URL", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Description and help text are identical. Consider making help text more concise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to 7b92eb6 in 1 minute and 32 seconds. Click for details.
- Reviewed
71
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_RXy2udHh7fORsoXU
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
src/lmnr/cli.py
Outdated
@@ -16,6 +19,39 @@ | |||
EVAL_DIR = "evals" | |||
|
|||
|
|||
def add_cursor_rules(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'args' parameter isn’t used in add_cursor_rules
. Consider either using it or removing it from the signature.
def add_cursor_rules(args): | |
def add_cursor_rules(): |
LOG.info(f"Downloading laminar.mdc from {url}") | ||
|
||
# Download the file | ||
with urllib.request.urlopen(url) as response: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a timeout to urllib.request.urlopen
to prevent hanging if the URL becomes unresponsive.
with urllib.request.urlopen(url) as response: | |
with urllib.request.urlopen(url, timeout=10) as response: |
LOG.info(f"Successfully downloaded laminar.mdc to {target_file}") | ||
|
||
except urllib.error.URLError as e: | ||
LOG.error(f"Failed to download file from {url}: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of directly logging and calling sys.exit
, consider using LOG.exception
to capture the full stack trace for debugging.
LOG.error(f"Failed to download file from {url}: {e}") | |
LOG.exception(f"Failed to download file from {url}: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 9fee6bb in 26 seconds. Click for details.
- Reviewed
31
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/lmnr/cli.py:22
- Draft comment:
Good removal of the unused 'args' parameter from add_cursor_rules. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. src/lmnr/cli.py:152
- Draft comment:
Updated the call to add_cursor_rules() to match its new signature. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
Workflow ID: wflow_6Ugzjmm1KCbL5Qgd
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 68d1ac4 in 28 seconds. Click for details.
- Reviewed
26
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pyproject.toml:9
- Draft comment:
Version bump to 0.6.6 is applied correctly. Ensure changelog and related docs are updated accordingly. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. src/lmnr/version.py:6
- Draft comment:
Updated version to 0.6.6. Consistent with pyproject.toml; looks good. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
Workflow ID: wflow_YXZwzhd1jgXUitU2
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Important
Adds
add-cursor-rules
CLI subcommand to downloadlaminar.mdc
file and updates version to0.6.6
.add_cursor_rules()
function incli.py
to downloadlaminar.mdc
from a hardcoded URL and save it to.cursor/rules/
.cli()
incli.py
to includeadd-cursor-rules
subcommand for downloading the file.0.6.5
to0.6.6
inpyproject.toml
andversion.py
.This description was created by
for 68d1ac4. You can customize this summary. It will automatically update as commits are pushed.