Skip to content

refactor: remove global statement in _init function - #9

Open
deepsource-dev-autofix[bot] wants to merge 1 commit into
mainfrom
deepsource-autofix-bd495a2d
Open

refactor: remove global statement in _init function#9
deepsource-dev-autofix[bot] wants to merge 1 commit into
mainfrom
deepsource-autofix-bd495a2d

Conversation

@deepsource-dev-autofix

Copy link
Copy Markdown

This PR refactors the module docstring initialization to eliminate the use of a global statement. The _init function now takes the current module docstring as an argument, builds and returns the updated docstring, and the result is assigned back to __doc__.

  • global statement detected: The original _init function declared global __doc__ to modify the module docstring directly, introducing hidden dependencies and side effects. We removed the global declaration, added a current_doc parameter to _init, constructed the new docstring within the function, returned it, and assigned it to __doc__, thereby improving clarity and testability.

This Autofix was generated by AI. Please review the change before merging.

This PR refactors the module docstring initialization to eliminate the use of a global statement. The `_init` function now takes the current module docstring as an argument, builds and returns the updated docstring, and the result is assigned back to `__doc__`.

- global statement detected: The original `_init` function declared `global __doc__` to modify the module docstring directly, introducing hidden dependencies and side effects. We removed the global declaration, added a `current_doc` parameter to `_init`, constructed the new docstring within the function, returned it, and assigned it to `__doc__`, thereby improving clarity and testability.

> This Autofix was generated by AI. Please review the change before merging.
@deepsource-io

deepsource-io Bot commented Jun 10, 2025

Copy link
Copy Markdown

Here's the code health analysis summary for commits 1fac5ac..fba2a6f. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development

Copy link
Copy Markdown

Here's the code health analysis summary for commits 1fac5ac..fba2a6f. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ Success
🎯 2 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

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.

0 participants