Conversation
I made a couple small tweaks to the docs, but this otherwise looked good to me.
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PLC0207 | 54 | 54 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+54 -54 violations, +0 -0 fixes in 13 projects; 42 projects unchanged)
PlasmaPy/PlasmaPy (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- noxfile.py:448:15: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + noxfile.py:448:15: PLC0207 [*] String is split more times than necessary
apache/airflow (+16 -16 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
- dev/backport/update_backport_status.py:80:21: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + dev/backport/update_backport_status.py:80:21: PLC0207 [*] String is split more times than necessary - dev/breeze/src/airflow_breeze/commands/common_options.py:524:26: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + dev/breeze/src/airflow_breeze/commands/common_options.py:524:26: PLC0207 [*] String is split more times than necessary - dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2815:50: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2815:50: PLC0207 [*] String is split more times than necessary - dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py:719:34: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py:719:34: PLC0207 [*] String is split more times than necessary - dev/breeze/src/airflow_breeze/utils/click_validators.py:46:17: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + dev/breeze/src/airflow_breeze/utils/click_validators.py:46:17: PLC0207 [*] String is split more times than necessary - dev/breeze/src/airflow_breeze/utils/run_utils.py:120:25: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + dev/breeze/src/airflow_breeze/utils/run_utils.py:120:25: PLC0207 [*] String is split more times than necessary - dev/breeze/src/airflow_breeze/utils/selective_checks.py:1766:23: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + dev/breeze/src/airflow_breeze/utils/selective_checks.py:1766:23: PLC0207 [*] String is split more times than necessary ... 18 additional changes omitted for project
apache/superset (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
- superset/db_engine_specs/lint_metadata.py:100:17: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + superset/db_engine_specs/lint_metadata.py:100:17: PLC0207 [*] String is split more times than necessary - tests/common/query_context_generator.py:214:29: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + tests/common/query_context_generator.py:214:29: PLC0207 [*] String is split more times than necessary - tests/common/query_context_generator.py:255:22: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + tests/common/query_context_generator.py:255:22: PLC0207 [*] String is split more times than necessary
bokeh/bokeh (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
- src/bokeh/io/notebook.py:663:26: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + src/bokeh/io/notebook.py:663:26: PLC0207 [*] String is split more times than necessary - src/bokeh/util/token.py:142:41: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + src/bokeh/util/token.py:142:41: PLC0207 [*] String is split more times than necessary - src/bokeh/util/token.py:155:41: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + src/bokeh/util/token.py:155:41: PLC0207 [*] String is split more times than necessary
freedomofpress/securedrop (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- securedrop/store.py:345:49: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + securedrop/store.py:345:49: PLC0207 [*] String is split more times than necessary
ibis-project/ibis (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- ibis/examples/gen_registry.py:125:52: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + ibis/examples/gen_registry.py:125:52: PLC0207 [*] String is split more times than necessary
langchain-ai/langchain (+10 -10 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- libs/langchain/langchain_classic/agents/chat/output_parser.py:66:22: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + libs/langchain/langchain_classic/agents/chat/output_parser.py:66:22: PLC0207 [*] String is split more times than necessary - libs/langchain/langchain_classic/agents/conversational/output_parser.py:34:28: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + libs/langchain/langchain_classic/agents/conversational/output_parser.py:34:28: PLC0207 [*] String is split more times than necessary - libs/langchain/langchain_classic/agents/mrkl/output_parser.py:72:28: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + libs/langchain/langchain_classic/agents/mrkl/output_parser.py:72:28: PLC0207 [*] String is split more times than necessary - libs/langchain/langchain_classic/agents/output_parsers/react_json_single_input.py:81:22: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + libs/langchain/langchain_classic/agents/output_parsers/react_json_single_input.py:81:22: PLC0207 [*] String is split more times than necessary - libs/langchain/langchain_classic/agents/output_parsers/react_single_input.py:72:28: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + libs/langchain/langchain_classic/agents/output_parsers/react_single_input.py:72:28: PLC0207 [*] String is split more times than necessary ... 10 additional changes omitted for project
pandas-dev/pandas (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- pandas/compat/_optional.py:165:14: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + pandas/compat/_optional.py:165:14: PLC0207 [*] String is split more times than necessary
pypa/cibuildwheel (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- bin/update_pythons.py:129:22: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + bin/update_pythons.py:129:22: PLC0207 [*] String is split more times than necessary - cibuildwheel/platforms/macos.py:154:31: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + cibuildwheel/platforms/macos.py:154:31: PLC0207 [*] String is split more times than necessary - cibuildwheel/selector.py:78:26: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + cibuildwheel/selector.py:78:26: PLC0207 [*] String is split more times than necessary
zulip/zulip (+10 -10 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
- zerver/lib/send_email.py:301:16: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + zerver/lib/send_email.py:301:16: PLC0207 [*] String is split more times than necessary - zerver/lib/send_email.py:449:21: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + zerver/lib/send_email.py:449:21: PLC0207 [*] String is split more times than necessary - zerver/lib/webhooks/common.py:284:26: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + zerver/lib/webhooks/common.py:284:26: PLC0207 [*] String is split more times than necessary - zerver/lib/webhooks/common.py:296:16: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + zerver/lib/webhooks/common.py:296:16: PLC0207 [*] String is split more times than necessary - zerver/middleware.py:230:49: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + zerver/middleware.py:230:49: PLC0207 [*] String is split more times than necessary ... 10 additional changes omitted for project
wntrblm/nox (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- tests/test_sessions.py:1279:44: PLC0207 [*] Replace with `rsplit(..., maxsplit=1)`. + tests/test_sessions.py:1279:44: PLC0207 [*] String is split more times than necessary
pytest-dev/pytest (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- src/_pytest/config/findpaths.py:236:16: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + src/_pytest/config/findpaths.py:236:16: PLC0207 [*] String is split more times than necessary - src/_pytest/terminal.py:1037:40: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + src/_pytest/terminal.py:1037:40: PLC0207 [*] String is split more times than necessary - src/_pytest/terminal.py:479:41: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + src/_pytest/terminal.py:479:41: PLC0207 [*] String is split more times than necessary
astropy/astropy (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
- astropy/io/ascii/latex.py:438:16: PLC0207 [*] Replace with `split(..., maxsplit=1)`. + astropy/io/ascii/latex.py:438:16: PLC0207 [*] String is split more times than necessary
Changes by rule (1 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PLC0207 | 108 | 54 | 54 | 0 | 0 |
|
The ecosystem results look good overall. There's one (two?) arguable false negative where the pattern the rule is meant to detect occurs three times in the same statement: base_name = package_name.split("[")[0].split(">")[0].split("<")[0].split("=")[0]This seems rare enough not to worry too much about, although there was a second instance in the ecosystem report. I also don't really love our diagnostic here. I kind of think the |
|
@amyreese thanks for the review! What do you think of the new |
|
I like it :) |
Since these are false negatives, not false positives, I'm not too worried. We can try to improve the sensitivity later. |
I made a couple small tweaks to the docs, but this otherwise looked good to me.
https://docs.astral.sh/ruff/rules/missing-maxsplit-arg/