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

Update PTH122 documentation to include Path.stem and Path.parent #6884

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

charliermarsh
Copy link
Member

Closes #6846.

@charliermarsh charliermarsh added the documentation Improvements or additions to documentation label Aug 25, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) August 25, 2023 22:06
@charliermarsh charliermarsh merged commit e0a4078 into main Aug 25, 2023
16 checks passed
@charliermarsh charliermarsh deleted the charlie/pth122 branch August 25, 2023 22:11
@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2023

PR Check Results

Ecosystem

ℹ️ ecosystem check detected changes. (+43, -43, 0 error(s))

airflow (+12, -12)

- airflow/cli/commands/internal_api_command.py:173:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/cli/commands/internal_api_command.py:173:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/cli/commands/webserver_command.py:477:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/cli/commands/webserver_command.py:477:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/dag_processing/manager.py:1047:21: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/dag_processing/manager.py:1047:21: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/dag_processing/manager.py:855:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/dag_processing/manager.py:855:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/models/dagbag.py:328:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/models/dagbag.py:328:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/models/dagbag.py:382:33: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/models/dagbag.py:382:33: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/plugins_manager.py:257:30: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/plugins_manager.py:257:30: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/providers/apache/hive/transfers/s3_to_hive.py:159:23: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/providers/apache/hive/transfers/s3_to_hive.py:159:23: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- airflow/utils/file.py:316:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ airflow/utils/file.py:316:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- tests/plugins/test_plugin_ignore.py:120:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ tests/plugins/test_plugin_ignore.py:120:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- tests/plugins/test_plugin_ignore.py:93:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ tests/plugins/test_plugin_ignore.py:93:27: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- tests/system/providers/amazon/aws/utils/__init__.py:70:12: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ tests/system/providers/amazon/aws/utils/__init__.py:70:12: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`

bokeh (+14, -14)

- src/bokeh/application/handlers/code.py:169:22: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/application/handlers/code.py:169:22: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/application/handlers/server_lifecycle.py:128:26: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/application/handlers/server_lifecycle.py:128:26: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/application/handlers/server_request_handler.py:121:26: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/application/handlers/server_request_handler.py:121:26: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/command/subcommands/file_output.py:199:33: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/command/subcommands/file_output.py:199:33: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/io/export.py:419:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/io/export.py:419:25: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/io/util.py:83:15: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/io/util.py:83:15: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/util/sampledata.py:134:33: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/util/sampledata.py:134:33: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/util/sampledata.py:212:22: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/util/sampledata.py:212:22: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/util/sampledata.py:215:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/util/sampledata.py:215:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/util/sampledata.py:79:22: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/util/sampledata.py:79:22: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- src/bokeh/util/sampledata.py:81:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ src/bokeh/util/sampledata.py:81:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- tests/codebase/test_code_quality.py:81:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ tests/codebase/test_code_quality.py:81:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- tests/codebase/test_windows_reserved_filenames.py:42:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ tests/codebase/test_windows_reserved_filenames.py:42:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- tests/support/util/examples.py:115:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ tests/support/util/examples.py:115:16: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`

zulip (+17, -17)

- tools/tests/test_zulint_custom_rules.py:39:24: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ tools/tests/test_zulint_custom_rules.py:39:24: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/emoji.py:155:20: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/emoji.py:155:20: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/integrations.py:127:20: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/integrations.py:127:20: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/integrations.py:243:23: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/integrations.py:243:23: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/sounds.py:12:21: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/sounds.py:12:21: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/storage.py:28:15: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/storage.py:28:15: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/upload/local.py:219:54: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/upload/local.py:219:54: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/upload/local.py:246:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/upload/local.py:246:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/upload/s3.py:438:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/upload/s3.py:438:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/lib/upload/s3.py:476:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/lib/upload/s3.py:476:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/migrations/0149_realm_emoji_drop_unique_constraint.py:84:20: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/migrations/0149_realm_emoji_drop_unique_constraint.py:84:20: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/tests/test_bots.py:1215:38: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/tests/test_bots.py:1215:38: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/tests/test_bots.py:271:38: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/tests/test_bots.py:271:38: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/tests/test_transfer.py:133:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/tests/test_transfer.py:133:50: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/tests/test_upload_local.py:207:46: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/tests/test_upload_local.py:207:46: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/tests/test_upload_s3.py:463:65: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/tests/test_upload_s3.py:463:65: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
- zerver/tests/test_urls.py:47:30: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`
+ zerver/tests/test_urls.py:47:30: PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`

Rules changed: 1
Rule Changes Additions Removals
PTH122 86 43 43

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      4.4±0.02ms     9.2 MB/sec    1.01      4.5±0.01ms     9.1 MB/sec
formatter/numpy/ctypeslib.py               1.00    885.9±2.49µs    18.8 MB/sec    1.00    885.2±2.26µs    18.8 MB/sec
formatter/numpy/globals.py                 1.01     83.6±0.44µs    35.3 MB/sec    1.00     83.1±0.50µs    35.5 MB/sec
formatter/pydantic/types.py                1.01  1683.3±12.64µs    15.2 MB/sec    1.00   1667.6±6.90µs    15.3 MB/sec
linter/all-rules/large/dataset.py          1.00     10.1±0.07ms     4.0 MB/sec    1.01     10.2±0.06ms     4.0 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      2.7±0.01ms     6.1 MB/sec    1.00      2.7±0.01ms     6.1 MB/sec
linter/all-rules/numpy/globals.py          1.00    382.0±1.17µs     7.7 MB/sec    1.00    381.5±0.52µs     7.7 MB/sec
linter/all-rules/pydantic/types.py         1.00      5.3±0.04ms     4.9 MB/sec    1.00      5.3±0.02ms     4.8 MB/sec
linter/default-rules/large/dataset.py      1.00      5.3±0.01ms     7.6 MB/sec    1.02      5.4±0.02ms     7.5 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1176.0±3.62µs    14.2 MB/sec    1.01   1192.7±5.43µs    14.0 MB/sec
linter/default-rules/numpy/globals.py      1.00    137.1±2.91µs    21.5 MB/sec    1.01    138.9±2.21µs    21.2 MB/sec
linter/default-rules/pydantic/types.py     1.00      2.4±0.03ms    10.6 MB/sec    1.01      2.4±0.01ms    10.5 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      5.2±0.05ms     7.9 MB/sec    1.01      5.2±0.07ms     7.8 MB/sec
formatter/numpy/ctypeslib.py               1.00    966.9±9.04µs    17.2 MB/sec    1.01   980.6±25.12µs    17.0 MB/sec
formatter/numpy/globals.py                 1.00     89.6±1.02µs    32.9 MB/sec    1.00     89.5±0.80µs    33.0 MB/sec
formatter/pydantic/types.py                1.00  1913.9±16.04µs    13.3 MB/sec    1.01  1924.9±47.82µs    13.2 MB/sec
linter/all-rules/large/dataset.py          1.00     12.4±0.16ms     3.3 MB/sec    1.02     12.6±0.15ms     3.2 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.5±0.05ms     4.8 MB/sec    1.00      3.5±0.03ms     4.8 MB/sec
linter/all-rules/numpy/globals.py          1.00    353.6±4.72µs     8.3 MB/sec    1.02    362.3±6.88µs     8.1 MB/sec
linter/all-rules/pydantic/types.py         1.00      6.5±0.07ms     3.9 MB/sec    1.01      6.5±0.07ms     3.9 MB/sec
linter/default-rules/large/dataset.py      1.00      6.8±0.05ms     6.0 MB/sec    1.01      6.9±0.06ms     5.9 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1415.7±11.29µs    11.8 MB/sec    1.02  1441.6±17.80µs    11.6 MB/sec
linter/default-rules/numpy/globals.py      1.00    146.2±2.12µs    20.2 MB/sec    1.01    147.6±2.22µs    20.0 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.1±0.03ms     8.3 MB/sec    1.01      3.1±0.03ms     8.3 MB/sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PTH122 makes an inaccurate (incomplete) recommendation
1 participant