Skip to content
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

Use Python version to determine typing rewrite safety #8919

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

charliermarsh
Copy link
Member

Summary

These rewrites are only (potentially) unsafe on Python versions that predate their introduction into the standard library and grammar, so it seems correct to mark them as safe on those later versions.

@charliermarsh charliermarsh added the preview Related to preview mode features label Nov 30, 2023
Base automatically changed from charlie/unsafe to main November 30, 2023 01:51
Copy link
Contributor

github-actions bot commented Nov 30, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +2694 -0 fixes in 41 projects)

demisto/content (+0 -0 violations, +2692 -0 fixes)

ruff check --no-cache --exit-zero --preview

- Packs/AMP/Integrations/AMPv2/AMPv2.py:3240:11: UP007 Use `X | Y` for type annotations
+ Packs/AMP/Integrations/AMPv2/AMPv2.py:3240:11: UP007 [*] Use `X | Y` for type annotations
- Packs/AMP/Integrations/AMPv2/AMPv2.py:3241:16: UP007 Use `X | Y` for type annotations
+ Packs/AMP/Integrations/AMPv2/AMPv2.py:3241:16: UP007 [*] Use `X | Y` for type annotations
- Packs/AMP/Integrations/AMPv2/AMPv2.py:3242:12: UP007 Use `X | Y` for type annotations
+ Packs/AMP/Integrations/AMPv2/AMPv2.py:3242:12: UP007 [*] Use `X | Y` for type annotations
- Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py:756:24: UP007 Use `X | Y` for type annotations
+ Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py:756:24: UP007 [*] Use `X | Y` for type annotations
- Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector_test.py:34:105: UP007 Use `X | Y` for type annotations
+ Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector_test.py:34:105: UP007 [*] Use `X | Y` for type annotations
- Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector_test.py:35:48: UP007 Use `X | Y` for type annotations
+ Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector_test.py:35:48: UP007 [*] Use `X | Y` for type annotations
- Packs/AccentureCTI_Feed/Integrations/ACTIIndicatorFeed/ACTIIndicatorFeed.py:122:60: UP007 Use `X | Y` for type annotations
+ Packs/AccentureCTI_Feed/Integrations/ACTIIndicatorFeed/ACTIIndicatorFeed.py:122:60: UP007 [*] Use `X | Y` for type annotations
- Packs/AccentureCTI_Feed/Integrations/ACTIIndicatorFeed/ACTIIndicatorFeed.py:134:33: UP007 Use `X | Y` for type annotations
+ Packs/AccentureCTI_Feed/Integrations/ACTIIndicatorFeed/ACTIIndicatorFeed.py:134:33: UP007 [*] Use `X | Y` for type annotations
- Packs/AgariPhishingDefense/Integrations/AgariPhishingDefense/AgariPhishingDefense.py:586:6: UP007 Use `X | Y` for type annotations
+ Packs/AgariPhishingDefense/Integrations/AgariPhishingDefense/AgariPhishingDefense.py:586:6: UP007 [*] Use `X | Y` for type annotations
- Packs/AgariPhishingDefense/Integrations/AgariPhishingDefense/AgariPhishingDefense.py:622:6: UP007 Use `X | Y` for type annotations
+ Packs/AgariPhishingDefense/Integrations/AgariPhishingDefense/AgariPhishingDefense.py:622:6: UP007 [*] Use `X | Y` for type annotations
- Packs/Akamai_SIEM/Integrations/Akamai_SIEM/Akamai_SIEM.py:111:21: UP007 Use `X | Y` for type annotations
+ Packs/Akamai_SIEM/Integrations/Akamai_SIEM/Akamai_SIEM.py:111:21: UP007 [*] Use `X | Y` for type annotations
- Packs/Akamai_SIEM/Integrations/Akamai_SIEM/Akamai_SIEM.py:121:42: UP007 Use `X | Y` for type annotations
+ Packs/Akamai_SIEM/Integrations/Akamai_SIEM/Akamai_SIEM.py:121:42: UP007 [*] Use `X | Y` for type annotations
- Packs/Akamai_SIEM/Integrations/Akamai_SIEM/Akamai_SIEM.py:256:22: UP007 Use `X | Y` for type annotations
... 2666 additional changes omitted for rule UP007
- Packs/GoogleDocs/Integrations/GoogleDocs/GoogleDocs.py:315:20: UP006 Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation
+ Packs/GoogleDocs/Integrations/GoogleDocs/GoogleDocs.py:315:20: UP006 [*] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation
... 2665 additional changes omitted for project

rotki/rotki (+0 -0 violations, +2 -0 fixes)

ruff check --no-cache --exit-zero --preview

- packaging/docker/entrypoint.py:54:32: UP007 Use `X | Y` for type annotations
+ packaging/docker/entrypoint.py:54:32: UP007 [*] Use `X | Y` for type annotations

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
UP007 2692 0 0 2692 0
UP006 2 0 0 2 0

@charliermarsh charliermarsh merged commit 073eddb into main Nov 30, 2023
17 checks passed
@charliermarsh charliermarsh deleted the charlie/up-safe branch November 30, 2023 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants