-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix pylint 4.0.4 distro #45006
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
Fix pylint 4.0.4 distro #45006
Conversation
There was a problem hiding this 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 pull request fixes pylint 4.0.4 compatibility issues across the azure-monitor-opentelemetry package. The changes address new linting rules by improving code quality through better import ordering, adding necessary encoding specifications, removing unused imports, and adding appropriate pylint disable comments where the warnings are intentional or false positives.
Changes:
- Removed unused imports and duplicate test methods
- Standardized import ordering (stdlib → third-party → azure packages)
- Added
encoding='utf-8'parameter to allopen()calls - Added pylint disable comments for intentional patterns (broad exceptions in samples, unused mock parameters in tests, etc.)
- Improved code quality (e.g., using context manager for
urlopen, renaming unclear parameter names, usingsys.exit()instead ofexit())
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test_utils.py | Removed unused import, added pylint disables for line length and unused arguments |
| test_configurations.py | Reordered imports, removed duplicate test method, added pylint disables |
| test_configure.py | Removed unused imports, added pylint disable for too-many-public-methods |
| test_psycopg2.py | Reordered imports (pytest after stdlib) |
| test_status_logger.py | Added encoding='utf-8' to open() calls |
| test_diagnostic_logging.py | Removed unused import, added encoding, added pylint disables |
| test_distro.py | Added pylint disable for unused-argument |
| test_configurator.py | Removed unused import, added pylint disable |
| Tracing samples (11 files) | Reordered imports, added pylint disables for intentional broad exceptions and other patterns |
| Django samples (5 files) | Import reordering, parameter renames (_request prefix), pylint disables |
| Metrics samples (5 files) | Import reordering, parameter renames (_options prefix), pylint disables |
| Logging samples (4 files) | Import reordering, parameter renames, pylint disables |
| Authentication samples (2 files) | Import reordering |
| instrumentation.py | Added pylint disable for logging warning without debug check |
| diagnostic_logging.py | Added pylint disable for logging error without debug check |
All SDK Contribution checklist:
General Guidelines and Best Practices