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

Implement B006 rule #2775

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

jamshale
Copy link
Contributor

@jamshale jamshale commented Feb 12, 2024

Add rule B006 to the linting config and implements it by creating empty objects in the functions when the parameter is None.

Didn't add any of the other B linting options.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@@ -60,6 +61,8 @@ async def get_wallet_profile(
Profile: Profile for the wallet record

"""
extra_settings = extra_settings or {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra_settings dict is overridden later in this function. I didn't want to change anything not related to the task but it seems like this might be a mistake.

@@ -228,10 +228,10 @@ async def schema_get(request: web.BaseRequest):
try:
schema = await anoncreds_registry.get_schema(context.profile, schema_id)
return web.json_response(schema.serialize())
except AnonCredsObjectNotFound:
raise web.HTTPNotFound(reason=f"Schema not found: {schema_id}")
except AnonCredsObjectNotFound as e:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had all of the B linting rules enabled for a bit and it flagged this.

@jamshale jamshale marked this pull request as ready for review February 12, 2024 18:24
@jamshale jamshale requested review from ianco and dbluhm February 12, 2024 18:42
Copy link
Contributor

@dbluhm dbluhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! More instances of this than I was expecting. Thanks!

@swcurran swcurran merged commit 98673e4 into openwallet-foundation:main Feb 12, 2024
8 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