-
Notifications
You must be signed in to change notification settings - Fork 50
dcnm_maintenance_mode: type hints #578
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
Open
allenrobel
wants to merge
18
commits into
develop
Choose a base branch
from
dcnm-maintenance-mode-type-hints
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No functional changes in this commit. Run black and isort.
No functional changes in this commit. Run black and isort linters against MaintenanceMode.
No functional changes in this commit. Run black and isort linters against dcnm_maintenance_mode.py.
No functional changes in this commit. Run black and isort linters against unit test files for dcnm_maintenance_mode.
No functional changes in this commit. This commit updates all docstrings to conform to the standards defined in CLAUDE.md (not in this repository). These standards include: 1. Structured headings # Summary ## Raises ### ValueError ## Other heading …etc 2. Single backticks around class, method, var, names, exception names, etc.
Fix below error: ERROR: tests/unit/module_utils/common/test_maintenance_mode.py:1238:161: E501: line too long (181 > 160 characters)
Add type hints for all vars and type annotations for all methods.
Certain dcnm_maintenance_mode unit test asserts will fail due to the changes in the last commit. Fixing that in this commit.
No functional changes in this commit. 1. Update all docstrings to conform to Markdown format. 2. Add module dostrings where missing. 3. Add pylint supression directive for __metaclass__ invalid-name
No functional changes in this commit. Update copyright dates for all unit test files associuated with dcnm_maintenance_mode.
1. Suppress invalid-name for __metaclass__ 2. Add module docstring
1. Add type hints for dcnm_maintenance_mode module and support classes. 2. Replace class decorators for RestSend and Results with local properties. - plugins/module_utils/common/maintenance_mode.py - plugins/module_utils/common/maintenance_mode_info.py - plugins/modules/dcnm_maintenance_mode.py 3. Update unit tests for the above 4. Some unit tests related to verifying Results is set are removed since they are no longer needed given that Results is instantiated in class initializers. 5. Add enums for maintenance mode values (e.g, “normal” “maintenance”).
1. Add blank lines where linters prefer them. 2. Move import after DOCUMENTATION.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR changes the following.
Adds type hints and method annotations for the dcnm_maintenance_mode module and its support classes.
Removes class decorators for RestSend and Results in favor of local properties for these classes (mypy does not understand the class decorator approach).
Updates unit tests to align with the above changes.
Notes to reviewers