Skip to content
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

Merged
merged 8 commits into from
May 21, 2024
Merged

Conversation

juancarlospaco
Copy link
Contributor

What kind of change does this PR introduce?

  • Update .pre-commit-config.yaml to use the latest versions of hooks.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a 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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
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 = (
Copy link
Contributor

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"]]
Copy link
Contributor

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.

Suggested change
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"]]
Copy link
Contributor

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.

Suggested change
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", [])]

Copy link
Contributor

@J0 J0 left a 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

Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.38%. Comparing base (63e028d) to head (9824403).
Report is 67 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@silentworks silentworks merged commit e00452c into supabase:main May 21, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants