-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
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.
@@ -103,8 +103,8 @@ def parse_sso_response(data: Any) -> SSOResponse: | |||
|
|||
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.
@@ -113,9 +113,11 @@ async def list_users(self, page: int = None, per_page: int = None) -> List[User] | |||
"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", []) | |
] |
@@ -113,9 +113,11 @@ def list_users(self, page: int = None, per_page: int = None) -> List[User]: | |||
"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", [])] |
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.yaml
to use the latest versions of hooks.