Skip to content

Fix pylint 4.0.4 linting errors in azure-ai-contentsafety#47736

Open
sunghyun1999 wants to merge 1 commit into
Azure:mainfrom
sunghyun1999:fix/contentsafety-pylint-errors
Open

Fix pylint 4.0.4 linting errors in azure-ai-contentsafety#47736
sunghyun1999 wants to merge 1 commit into
Azure:mainfrom
sunghyun1999:fix/contentsafety-pylint-errors

Conversation

@sunghyun1999

Copy link
Copy Markdown

Summary

Fix pylint errors in azure-ai-contentsafety for the upcoming pylint 4.0.4 upgrade (deadline: 2026-07-13).

Changes

  • tests/test_blocklist.py: Fix import order — place third-party imports (devtools_testutils, test_case) before first-party imports (azure.*). Group azure imports together. (C0411, C0412)
  • tests/test_case.py: Fix import order — place third-party imports before first-party imports. Group azure imports together. (C0411, C0412)
  • tests/test_content_safety.py: Fix import order — place third-party imports before first-party imports. (C0411)
  • samples/sample_manage_blocklist.py: Break 3 lines exceeding 120-char limit into multiple lines. (C0301)

Fixes #33222

🤖 Generated with Claude Code

Fix linting errors flagged by the upcoming pylint 4.0.4 upgrade:

- tests/test_blocklist.py: fix import order and grouping (C0411, C0412)
- tests/test_case.py: fix import order and grouping (C0411, C0412)
- tests/test_content_safety.py: fix import order (C0411)
- samples/sample_manage_blocklist.py: fix line-too-long (C0301)

Fixes Azure#33222

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sunghyun1999 sunghyun1999 requested a review from mengaims as a code owner June 29, 2026 01:10
Copilot AI review requested due to automatic review settings June 29, 2026 01:10
@github-actions github-actions Bot added Cognitive - Content Safety Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jun 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution @sunghyun1999! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes pylint 4.0.4 lint errors in azure-ai-contentsafety ahead of the 2026-07-13 pylint upgrade deadline (issue #33222). The changes are limited to test and sample files: reordering imports to satisfy C0411/C0412 and breaking over-length lines to satisfy C0301. No production library code is touched, so the change is low-risk.

Changes:

  • Reorder imports in three test files so third-party imports precede grouped/alphabetized first-party azure.* imports.
  • Split three lines exceeding the 120-char limit in the sample into multi-line f-strings and a multi-line comment.
  • All previously imported symbols are preserved; no functional changes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/test_content_safety.py Reorder/group imports; alphabetize model imports (all 7 retained)
tests/test_case.py Group azure.* imports; sort within group
tests/test_blocklist.py Reorder imports; alphabetize model imports
samples/sample_manage_blocklist.py Break 3 long lines (2 f-strings, 1 comment) into multiple lines

@sunghyun1999

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cognitive - Content Safety Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azure-ai-contentsafety needs linting updates for pylint version 4.0.4

3 participants