Skip to content

Conversation

@l0lawrence
Copy link
Member

@l0lawrence l0lawrence commented Jan 6, 2026

image

@l0lawrence l0lawrence marked this pull request as ready for review January 6, 2026 23:03
Copilot AI review requested due to automatic review settings January 6, 2026 23:03
Copy link
Contributor

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 adds a new pylint checker DoNotStoreSecretsInTestVariables (C4773) to prevent storing secrets in variables within test files, encouraging developers to use secrets directly in function calls instead.

Key Changes:

  • Implements the new checker class with logic to detect secret assignments and usage in test files
  • Adds comprehensive test coverage for the new checker
  • Updates documentation to reflect the new C4773 rule

Reviewed changes

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

Show a summary per file
File Description
pylint_guidelines_checker.py Implements the DoNotStoreSecretsInTestVariables checker class (C4773) that detects when secrets are assigned to variables in test files and flags both the assignment and usage
test_pylint_custom_plugins.py Adds comprehensive test cases covering secret assignments, multiple secrets, different contexts (if/for), direct usage, and non-test file scenarios
test_do_not_store_secrets_in_test_variables.py Provides test data with mock classes and functions demonstrating both problematic patterns (storing secrets in variables) and correct patterns (direct secret usage)
README.md Updates documentation range to C4717-C4773 and adds the new rule entry with description, disable command, guideline link, and example reference
__init__.py Replaces external imports with local class definitions to improve test isolation

Copy link

@iscai-msft iscai-msft left a comment

Choose a reason for hiding this comment

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

have you any wool

@l0lawrence l0lawrence merged commit e32a1f3 into Azure:main Jan 7, 2026
7 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.

2 participants