ruff: drop deprecated UP038 rule check - #45227
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the deprecated Ruff rule UP038 (“non-pep604-isinstance”) from this repository’s Ruff selection lists and cleans up now-unnecessary noqa: UP038 suppressions, aligning the repo with newer Ruff versions where UP038 is removed.
Changes:
- Dropped
UP038frompyproject.tomlRuffselectlist. - Dropped
UP038fromnightly_ruff.tomllint.selectlist. - Removed
# noqa: UP038suppressions inRubrikPolaris.pywhere the rule no longer applies/is selected.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pyproject.toml | Removes UP038 from the primary Ruff rule selection. |
| Packs/RubrikPolaris/Integrations/RubrikPolaris/RubrikPolaris.py | Removes # noqa: UP038 comments from isinstance(..., (dict, list)) checks. |
| nightly_ruff.toml | Removes UP038 from the nightly Ruff rule selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @kamalq97 will know the proposed changes are ready to be reviewed. |
|
Hi @Andrej730, thanks for contributing to the XSOAR marketplace. To receive credit for your generous contribution please follow this link. |
🤖 AI-Powered Code Review AvailableHi @kamalq97, you can leverage AI-powered code review to assist with this PR! Available Commands:
|
ShacharKidor
left a comment
There was a problem hiding this comment.
Hi @Andrej730,
Thank you for your contribution.
PR is approved.
88c1b99
into
demisto:contrib/Andrej730_drop-ruff-up038
|
Thank you for your contribution. Your external PR has been merged and the changes are now included in one or more internal PRs for further review. Note Contributions containing XSIAM content (Modeling Rules, Parsing Rules, Correlation Rules, or Dashboards) are subject to an additional review process and may take longer to be merged to master. |
* `ruff`: drop deprecated `UP038` rule check (#45227) * Added RN + fixed BA133 --------- Co-authored-by: Andrej730 <azhilenkov@gmail.com> Co-authored-by: ShacharKidor <skidorball@paloaltonetworks.com>
## Summary Reintroducing `demisto/content` back to `ruff-ecosystem`, it's a huge repo with 4.5K py file and 2.5M loc, so may have catch some cases for ecosystem report. It was previously commented out in #12129 due to the use of removed `E999` Issue with the use of removed rules upstream is resolved, though apparently `E999` was dropped from selection a while ago and new issue with the use of removed `UP038` occurred, but it's resolved now too - demisto/content#45227 Syntax error in still present in https://github.com/demisto/content/blob/master/Packs/ThreatQ/Integrations/ThreatQ/ThreatQ.py, so keeping `exclude`. Though apparently it doesn't break `ruff-ecosystem` anymore, but keeping it safe for now. I've submitted a fix upstream demisto/content#45275, so `exclude` can be removed later too. ## Test Plan Tested running `ruff-ecosystem` locally, no issues found.
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Description
Same reasoning as #43981:
UP038was deprecated since March 2025 https://astral.sh/blog/ruff-v0.10.0#rule-deprecations and removed in September 2025 https://astral.sh/blog/ruff-v0.13.0#rule-removals0.8.0, but this change will help prepare to version bump in the futurecontent/.pre-commit-config_template.yaml
Line 38 in 6f9070a
ruff-ecosystemcheck - basically comparing differences before and after changes in ruff on the real code to see what effect they have on Python ecosystem. It was commented out a while a go because removedE999rule was used - this rule no longer an issue, butUP038is a new blocker.https://github.com/astral-sh/ruff/blob/34d0944f3b1d0ce51db6a583e17faeb933df9be6/python/ruff-ecosystem/ruff_ecosystem/defaults.py#L44-L52
Must have
relates: https://jira-dc.paloaltonetworks.com/browse/CIAC-17453