-
-
Notifications
You must be signed in to change notification settings - Fork 53
Update .pre-commit-config.yaml #487
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.
Hey @juancarlospaco - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
|
|
||
| def get_error_message(error: Any) -> str: | ||
| props = ["msg", "message", "error_description", "error"] | ||
| filter = ( |
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 (code_refinement): Review the necessity of changing the lambda function to a single line.
This change might slightly reduce readability by compacting the logic into a single line. Consider if the benefits of this change outweigh the potential decrease in clarity.
| "GET", | ||
| "admin/users", | ||
| query={"page": page, "per_page": per_page}, | ||
| xform=lambda data: [model_validate(User, user) for user in data["users"]] |
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 (code_refinement): Consider the impact of changing lambda expressions to include additional parentheses.
This change might improve readability by making the structure of the lambda function clearer, but it could also introduce unnecessary complexity if not widely adopted across the project.
| xform=lambda data: [model_validate(User, user) for user in data["users"]] | |
| xform=lambda data: [ | |
| model_validate(User, user) for user in data.get("users", []) | |
| ] |
| "GET", | ||
| "admin/users", | ||
| query={"page": page, "per_page": per_page}, | ||
| xform=lambda data: [model_validate(User, user) for user in data["users"]] |
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 (code_refinement): Assess the addition of parentheses in lambda functions for consistency.
While this might enhance readability in some contexts, ensure it aligns with the coding standards and practices within the rest of the project.
| xform=lambda data: [model_validate(User, user) for user in data["users"]] | |
| xform=lambda data: [model_validate(User, user) for user in data.get("users", [])] |
J0
left a comment
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.
Thanks! LGTM. Please wait for CI to pass before merging though
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #487 +/- ##
==========================================
- Coverage 44.71% 44.38% -0.33%
==========================================
Files 23 23
Lines 2044 2032 -12
==========================================
- Hits 914 902 -12
Misses 1130 1130 ☔ View full report in Codecov by Sentry. |
What kind of change does this PR introduce?
.pre-commit-config.yamlto use the latest versions of hooks.