-
Notifications
You must be signed in to change notification settings - Fork 0
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
#605: Ctrl-V should not paste text twice #1
base: base-sha/8653a31b23ca4b390fbada04782596bae42c38cf
Are you sure you want to change the base?
Conversation
This is a benchmark review for experiment This pull request was cloned from Experiment configurationreview_config:
# User configuration for the review
# - benchmark - use the user config from the benchmark reviews
# - <value> - use the value directly
user_review_config:
enable_ai_review: true
enable_rule_comments: false
enable_complexity_comments: benchmark
enable_security_comments: benchmark
enable_tests_comments: benchmark
enable_comment_suggestions: benchmark
enable_functionality_review: benchmark
enable_pull_request_summary: benchmark
enable_review_guide: benchmark
enable_approvals: true
ai_review_config:
# The model responses to use for the experiment
# - benchmark - use the model responses from the benchmark reviews
# - llm - call the language model to generate responses
model_responses:
comments_model: benchmark
comment_validation_model: benchmark
comment_suggestion_model: benchmark
complexity_model: benchmark
docstrings_model: benchmark
functionality_model: benchmark
security_model: benchmark
tests_model: benchmark
# The pull request dataset to run the experiment on
pull_request_dataset:
- https://github.com/mraniki/MyLLM/pull/560
- https://github.com/Bilbottom/billiam-database/pull/92
- https://github.com/Bilbottom/loan-calcs/pull/1
- https://github.com/Bilbottom/sql-learning-materials/pull/28
- https://github.com/flet-dev/flet/pull/3522
- https://github.com/flet-dev/flet/pull/3523
- https://github.com/glenn-jocher/glenn-jocher/pull/15
- https://github.com/hbmartin/podcast-transcript-tools/pull/14
- https://github.com/joethesaint/Vue_0x01-Crash_Course/pull/9
- https://github.com/joethesaint/Vue_0x01-Crash_Course/pull/10
- https://github.com/pgarwol/medichain/pull/31
- https://github.com/pgarwol/medichain/pull/32
- https://github.com/pgarwol/medichain/pull/33
- https://github.com/pgarwol/medichain/pull/34
- https://github.com/MicroPanda123/bucket-webring/pull/1
- https://github.com/supabase-community/auth-py/pull/531
- https://github.com/supabase-community/auth-py/pull/532
- https://github.com/dreamerminsk/tasked/pull/59
- https://github.com/leaver2000/nzthermo/pull/23
- https://github.com/dreamerminsk/tasked/pull/58
- https://github.com/vicb/flyxc/pull/256
- https://github.com/CongLeSolutionX/conglesolutionx.github.io/pull/6
- https://github.com/CongLeSolutionX/conglesolutionx.github.io/pull/7
- https://github.com/CongLeSolutionX/conglesolutionx.github.io/pull/8
- https://github.com/CongLeSolutionX/conglesolutionx.github.io/pull/9
- https://github.com/CongLeSolutionX/conglesolutionx.github.io/pull/10
- https://github.com/CongLeSolutionX/conglesolutionx.github.io/pull/11
- https://github.com/Advik-B/LittleThings/pull/3
- https://github.com/theochem/iodata/pull/349
- https://github.com/theochem/iodata/pull/351
- https://github.com/theochem/iodata/pull/350
- https://github.com/iptux-src/iptux/pull/606
- https://github.com/iptux-src/iptux/pull/607
- https://github.com/EvickaStudio/PuzzelMVC/pull/1
- https://github.com/EvickaStudio/PuzzelMVC/pull/2
- https://github.com/EvickaStudio/PuzzelMVC/pull/3
- https://github.com/TeKrop/overfast-api/pull/145
- https://github.com/EvickaStudio/portfolio-website/pull/2
- https://github.com/EvickaStudio/portfolio-website/pull/3
- https://github.com/SilentDemonSD/WZML-X/pull/264
- https://github.com/R4vante/Physixed/pull/20
- https://github.com/R4vante/Physixed/pull/24
- https://github.com/bengosney/cerberus/pull/936
- https://github.com/yazdipour/OmnivoreQL/pull/27
- https://github.com/yazdipour/OmnivoreQL/pull/28
- https://github.com/gdsfactory/gdsfactory/pull/2904
- https://github.com/gdsfactory/kfactory/pull/407
- https://github.com/gdsfactory/cspdk/pull/47
- https://github.com/gdsfactory/gdsfactory/pull/2908
- https://github.com/gdsfactory/cspdk/pull/48
review_comment_labels:
- label: correct
question: Is this comment correct?
- label: helpful
question: Is this comment helpful?
- label: comment-type
question: Is the comment type correct?
- label: comment-area
question: Is the comment area correct?
- label: llm-test
question: |
What type of LLM test could this comment become?
- 👍 - this comment is really good/important and we should always make it
- 👎 - this comment is really bad and we should never make it
- no reaction - don't turn this comment into an LLM test
# Benchmark reviews generated by running
# python -m scripts.experiment benchmark <experiment_name>
benchmark_reviews: []
|
Reviewer's Guide by SourceryThis pull request addresses a bug where using Ctrl-V to paste text would result in the text being pasted twice. The text pasting logic was refactored to use the 'paste-clipboard' signal, and a new test was added to ensure correct functionality. File-Level Changes
Tips
|
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.
Hey @sourcery-ai-experiments-bot - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
@@ -376,4 +376,13 @@ GtkImage* igtk_image_new_with_size(const char* filename, | |||
return GTK_IMAGE(gtk_image_new_from_pixbuf(pixbuf)); | |||
} | |||
|
|||
string igtk_text_buffer_get_text(GtkTextBuffer* buffer) { |
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.
suggestion: Consider using std::string instead of string.
To maintain consistency and avoid potential issues with different string types, it's generally better to use std::string explicitly.
string igtk_text_buffer_get_text(GtkTextBuffer* buffer) { | |
std::string igtk_text_buffer_get_text(GtkTextBuffer* buffer) { |
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.
Is this comment correct?
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.
Is this comment helpful?
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.
Is the comment type correct?
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.
Is the comment area correct?
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.
What type of LLM test could this comment become?
- 👍 - this comment is really good/important and we should always make it
- 👎 - this comment is really bad and we should never make it
- no reaction - don't turn this comment into an LLM test
string igtk_text_buffer_get_text(GtkTextBuffer* buffer) { | ||
GtkTextIter start, end; | ||
gtk_text_buffer_get_bounds(buffer, &start, &end); | ||
char* res1 = gtk_text_buffer_get_text(buffer, &start, &end, FALSE); |
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.
issue (bug_risk): Check for null pointer before using res1.
If gtk_text_buffer_get_text returns a null pointer, it could lead to undefined behavior when constructing the std::string.
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.
Is this comment correct?
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.
Is this comment helpful?
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.
Is the comment type correct?
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.
Is the comment area correct?
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.
What type of LLM test could this comment become?
- 👍 - this comment is really good/important and we should always make it
- 👎 - this comment is really bad and we should never make it
- no reaction - don't turn this comment into an LLM test
Summary by Sourcery
This pull request addresses the issue where Ctrl-V would paste text twice by removing redundant text insertion logic. It also introduces a new helper function for retrieving text from GtkTextBuffer and adds unit tests to ensure the correct behavior of the text pasting functionality.