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

[ruff] d.update({k: v}) (RUF042) #14564

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

InSyncWithFoo
Copy link
Contributor

Summary

Resolves #13533.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

github-actions bot commented Nov 24, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+71 -0 violations, +0 -0 fixes in 9 projects; 46 projects unchanged)

RasaHQ/rasa (+11 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ rasa/core/channels/twilio.py:58:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/core/migrate.py:131:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/core/migrate.py:143:9: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/core/migrate.py:177:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/core/migrate.py:179:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/core/migrate.py:181:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/core/migrate.py:185:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/shared/core/domain.py:393:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/shared/core/domain.py:421:13: RUF042 [*] `dict.update` with single dictionary argument
+ rasa/shared/core/domain.py:426:13: RUF042 [*] `dict.update` with single dictionary argument
... 1 additional changes omitted for project

apache/airflow (+34 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ airflow/models/abstractoperator.py:369:17: RUF042 [*] `dict.update` with single dictionary argument
+ airflow/serialization/serialized_objects.py:1279:25: RUF042 [*] `dict.update` with single dictionary argument
+ airflow/serialization/serialized_objects.py:1549:13: RUF042 [*] `dict.update` with single dictionary argument
+ airflow/utils/file.py:214:13: RUF042 [*] `dict.update` with single dictionary argument
+ dev/stats/get_important_pr_candidates.py:371:13: RUF042 [*] `dict.update` with single dictionary argument
+ helm_tests/other/test_keda.py:140:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/amazon/aws/hooks/sagemaker.py:1285:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/amazon/aws/hooks/sagemaker.py:1289:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/google/cloud/transfers/cassandra_to_gcs.py:328:9: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/google/cloud/transfers/cassandra_to_gcs.py:329:9: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/google/cloud/transfers/cassandra_to_gcs.py:330:9: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/google/cloud/transfers/cassandra_to_gcs.py:333:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/google/marketing_platform/hooks/search_ads.py:125:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/google/marketing_platform/hooks/search_ads.py:127:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/google/marketing_platform/hooks/search_ads.py:195:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/openlineage/plugins/adapter.py:456:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/openlineage/plugins/adapter.py:464:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/openlineage/plugins/adapter.py:483:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/openlineage/plugins/adapter.py:487:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/src/airflow/providers/openlineage/plugins/adapter.py:495:13: RUF042 [*] `dict.update` with single dictionary argument
+ providers/tests/amazon/aws/hooks/test_sagemaker.py:183:1: RUF042 [*] `dict.update` with single dictionary argument
+ providers/tests/amazon/aws/hooks/test_sagemaker.py:189:1: RUF042 [*] `dict.update` with single dictionary argument
+ providers/tests/amazon/aws/sensors/test_sagemaker_training.py:41:1: RUF042 [*] `dict.update` with single dictionary argument
... 11 additional changes omitted for project

apache/superset (+4 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ superset/sql_lab.py:512:17: RUF042 [*] `dict.update` with single dictionary argument
+ superset/sql_lab.py:538:17: RUF042 [*] `dict.update` with single dictionary argument
+ superset/views/core.py:692:13: RUF042 [*] `dict.update` with single dictionary argument
+ superset/views/utils.py:227:25: RUF042 [*] `dict.update` with single dictionary argument

milvus-io/pymilvus (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ examples/orm/collection.py:163:9: RUF042 [*] `dict.update` with single dictionary argument
+ examples/orm/partition.py:98:9: RUF042 [*] `dict.update` with single dictionary argument

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

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ rotkehlchen/exchanges/bitstamp.py:259:21: RUF042 [*] `dict.update` with single dictionary argument
+ rotkehlchen/exchanges/bitstamp.py:414:17: RUF042 [*] `dict.update` with single dictionary argument
+ rotkehlchen/exchanges/poloniex.py:189:13: RUF042 [*] `dict.update` with single dictionary argument

zulip/zulip (+10 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ corporate/views/remote_billing_page.py:529:9: RUF042 [*] `dict.update` with single dictionary argument
+ corporate/views/remote_billing_page.py:538:9: RUF042 [*] `dict.update` with single dictionary argument
+ corporate/views/remote_billing_page.py:548:9: RUF042 [*] `dict.update` with single dictionary argument
+ corporate/views/remote_billing_page.py:552:9: RUF042 [*] `dict.update` with single dictionary argument
+ zerver/tests/test_markdown.py:1829:13: RUF042 [*] `dict.update` with single dictionary argument
+ zerver/tests/test_markdown.py:1867:13: RUF042 [*] `dict.update` with single dictionary argument
+ zerver/tests/test_markdown.py:1909:13: RUF042 [*] `dict.update` with single dictionary argument
+ zerver/tests/test_markdown.py:1945:13: RUF042 [*] `dict.update` with single dictionary argument
+ zerver/tests/test_markdown.py:1981:13: RUF042 [*] `dict.update` with single dictionary argument
+ zerver/tests/test_markdown.py:2011:13: RUF042 [*] `dict.update` with single dictionary argument

indico/indico (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ indico/web/forms/widgets.py:144:9: RUF042 [*] `dict.update` with single dictionary argument

pdm-project/pdm (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ src/pdm/formats/uv.py:219:9: RUF042 [*] `dict.update` with single dictionary argument
+ src/pdm/project/config.py:42:17: RUF042 [*] `dict.update` with single dictionary argument

astropy/astropy (+4 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ astropy/io/registry/core.py:218:21: RUF042 [*] `dict.update` with single dictionary argument
+ astropy/samp/integrated_client.py:400:13: RUF042 [*] `dict.update` with single dictionary argument
+ astropy/samp/integrated_client.py:402:13: RUF042 [*] `dict.update` with single dictionary argument
+ astropy/visualization/wcsaxes/core.py:320:13: RUF042 [*] `dict.update` with single dictionary argument

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RUF042 71 71 0 0 0

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

I think we have to align on the rule's scope first. @AlexWaygood mentioned that the rule could possibly be extended to cover more cases than just update. In that case, the rule should be named differently.

@MichaReiser MichaReiser added the needs-decision Awaiting a decision from a maintainer label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Awaiting a decision from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new rule - replace d.update({'key': 'value'}) with d['key'] = 'value'
2 participants