-
Notifications
You must be signed in to change notification settings - Fork 6
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
Kyu6: Valid Braces #542
Kyu6: Valid Braces #542
Conversation
Code Climate has analyzed commit 6b7111b and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 89.9% (0.0% change). View more on Code Climate. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #542 +/- ##
==========================================
+ Coverage 89.88% 89.92% +0.04%
==========================================
Files 169 170 +1
Lines 2541 2552 +11
==========================================
+ Hits 2284 2295 +11
Misses 257 257 ☔ View full report in Codecov by Sentry. |
./kyu_6/valid_braces/valid_braces.py:18:1: E302 expected 2 blank lines, found 1
Unnecessary elif after return
Reviewer's Guide by SourceryThis PR implements a solution for validating properly matched braces in a string. The implementation uses a dictionary-based approach to match opening and closing braces, with additional validation logic for string length and bracket positioning. Class diagram for Valid Braces FunctionclassDiagram
class valid_braces {
+valid_braces(string: str) bool
}
note for valid_braces "This function checks if the order of braces in a string is valid."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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 @ikostan - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a stack-based approach for validating braces to simplify the logic and improve efficiency.
- Add more test cases to cover edge cases, such as deeply nested braces, to ensure robustness.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Hi @ikostan! 👋
@sourcery-ai is now installed on this repository.
We found this recent PR of yours and reviewed it to show you what Sourcery can do.
If you want to review another PR, just comment with @sourcery-ai review
✨
kyu_6/valid_braces/valid_braces.py:36: error: Bracketed expression "[...]" is not valid as a type [valid-type]
kyu_6/valid_braces/valid_braces.py:30: error: Incompatible types in assignment (expression has type "int | None", variable has type "int") [assignment]
Summary by Sourcery
Add a new feature to validate strings of braces with the 'valid_braces' function, including comprehensive unit tests and documentation.
New Features:
Documentation:
Tests: