Skip to content

Conversation

@allenrobel
Copy link
Collaborator

@allenrobel allenrobel commented Nov 14, 2025

No functional changes in this PR.

** PLEASE MERGE THIS PR AFTER MERGING #553 **

This PR fixes various linter complaints and updates copyright dates. Specifically:

  1. Add pylint directive to suppress invalid-name for metaclass
  2. Ran black which reformatted lines to new relaxed line length
  3. Update copyright from 2024 to 2024-2025

No functional changes in this commit.

This commit adds type hints and removes class decorator @Properties.add_rest_send in favor of a class property for RestSend.
No functional changes in this commit.

Run linters to fix Ansible sanity tests for dcnm_bootflash.py
1. Address Copilot review commit regarding unused import.

2. Run black linter

3. Add pylint directive to suppress invalid-name.
1. Update copyright for all files

2. Add pylint directive to suppress invalid-name for __metaclass__

3. Run linters (black reformatted multiple lines to new relaxed line length)
@allenrobel allenrobel self-assigned this Nov 14, 2025
@allenrobel allenrobel requested a review from Copilot November 14, 2025 18:32
Copilot finished reviewing on behalf of allenrobel November 14, 2025 18:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the DcnmBootflash module and its unit tests with linter fixes, code reformatting, and copyright updates. While the PR description states "No functional changes," several logic modifications in conditional statements alter validation behavior in potentially breaking ways.

Key Changes

  • Added # pylint: disable=invalid-name directives for __metaclass__ assignments across all test files and the main module
  • Reformatted imports and multi-line statements to single lines using black formatter
  • Updated copyright headers from "2024" to "2024-2025" across all files
  • Added type annotations throughout dcnm_bootflash.py and introduced from typing import Any import
  • Changed _rest_send initialization from None to RestSend({}) with corresponding test updates
  • Added explicit rest_send property getter/setter implementation
  • Modified conditional logic from explicit is None checks to truthy/falsy checks (behavioral change)

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit/modules/dcnm/dcnm_bootflash/utils.py Added pylint directive, copyright update, consolidated multi-line imports, added author metadata
tests/unit/modules/dcnm/dcnm_bootflash/test_convert_target_to_params.py Added pylint directive, updated copyright, consolidated imports
tests/unit/modules/dcnm/dcnm_bootflash/test_convert_file_info_to_target.py Added pylint directive, updated copyright, consolidated imports and simplified multi-line string concatenation
tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_query.py Added pylint directive, updated copyright, consolidated imports, updated test assertions to expect initialized RestSend instead of None
tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_info.py Added pylint directive, updated copyright, consolidated multi-line imports
tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_files.py Added pylint directive, updated copyright, consolidated imports, simplified multi-line assertions and decorators
tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_deleted.py Added pylint directive, updated copyright, consolidated imports, updated test assertions for initialized RestSend, simplified assertions
tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_common.py Added pylint directive, updated copyright, consolidated imports, updated test assertions for initialized RestSend
tests/unit/modules/dcnm/dcnm_bootflash/fixture.py Added pylint directive, copyright update, added author metadata
plugins/modules/dcnm_bootflash.py Added pylint directive, consolidated imports, added type annotations, changed _rest_send initialization, added rest_send property, modified validation conditionals (behavioral changes), improved error handling in main(), documentation formatting inconsistencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@allenrobel
Copy link
Collaborator Author

Copilot's comments about functional changes are not relevant to this PR. Rather they are relevant (and addressed in) PR #553.

Please merge #553 before merging #554

@allenrobel allenrobel added the ready for review PR is ready to be reviewed label Nov 14, 2025
@allenrobel
Copy link
Collaborator Author

Closing this in favor of updating individual unit tests along with their associated files in module_utils.

@allenrobel allenrobel closed this Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants