Skip to content

ruff: drop deprecated UP038 rule check - #45227

Merged
ShacharKidor merged 1 commit into
demisto:contrib/Andrej730_drop-ruff-up038from
Andrej730:drop-ruff-up038
Jul 28, 2026
Merged

ruff: drop deprecated UP038 rule check#45227
ShacharKidor merged 1 commit into
demisto:contrib/Andrej730_drop-ruff-up038from
Andrej730:drop-ruff-up038

Conversation

@Andrej730

@Andrej730 Andrej730 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Description

Same reasoning as #43981:

  • this repo used to be part of ruff-ecosystem check - 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 removed E999 rule was used - this rule no longer an issue, but UP038 is a new blocker.

https://github.com/astral-sh/ruff/blob/34d0944f3b1d0ce51db6a583e17faeb933df9be6/python/ruff-ecosystem/ruff_ecosystem/defaults.py#L44-L52

    # Disabled due to use of explicit `select` with `E999`, which has been removed.
    # See: https://github.com/astral-sh/ruff/pull/12129
    # Project(
    #     repo=Repository(owner="demisto", name="content", ref="master"),
    #     format_options=FormatOptions(
    #         # Syntax errors in this file
    #         exclude="Packs/ThreatQ/Integrations/ThreatQ/ThreatQ.py"
    #     ),
    # ),

Must have

  • Tests
  • Documentation

relates: https://jira-dc.paloaltonetworks.com/browse/CIAC-17453

Copilot AI review requested due to automatic review settings July 24, 2026 22:54
@CLAassistant

CLAassistant commented Jul 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@content-bot content-bot added Community Contribution Form Filled Whether contribution form filled or not. labels Jul 24, 2026
@content-bot content-bot added Contribution Thank you! Contributions are always welcome! External PR Partner Support Level Indicates that the contribution is for Partner supported pack labels Jul 24, 2026
@content-bot
content-bot changed the base branch from master to contrib/Andrej730_drop-ruff-up038 July 24, 2026 22:55

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

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 UP038 from pyproject.toml Ruff select list.
  • Dropped UP038 from nightly_ruff.toml lint.select list.
  • Removed # noqa: UP038 suppressions in RubrikPolaris.py where 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.

@content-bot

Copy link
Copy Markdown
Contributor

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.
For your convenience, here is a link to the contributions SLAs document.

@content-bot

Copy link
Copy Markdown
Contributor

Hi @Andrej730, thanks for contributing to the XSOAR marketplace. To receive credit for your generous contribution please follow this link.

@content-bot

Copy link
Copy Markdown
Contributor

🤖 AI-Powered Code Review Available

Hi @kamalq97, you can leverage AI-powered code review to assist with this PR!

Available Commands:

  • @marketplace-ai-reviewer start review - Initiate a full AI code review
  • @marketplace-ai-reviewer re-review - Incremental review for new commits

@ShacharKidor ShacharKidor 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.

Hi @Andrej730,
Thank you for your contribution.

PR is approved.

@ShacharKidor
ShacharKidor merged commit 88c1b99 into demisto:contrib/Andrej730_drop-ruff-up038 Jul 28, 2026
89 of 101 checks passed
@github-actions

Copy link
Copy Markdown

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.

@Andrej730
Andrej730 deleted the drop-ruff-up038 branch July 28, 2026 17:45
ShacharKidor added a commit that referenced this pull request Jul 29, 2026
* `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>
ntBre pushed a commit to astral-sh/ruff that referenced this pull request Jul 29, 2026
## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! docs-approved External PR Partner Support Level Indicates that the contribution is for Partner supported pack Partner-Approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants