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

Rename *-length options to -width #8010

Closed
wants to merge 1 commit into from
Closed

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Oct 17, 2023

Summary

This PR deprecates the line-length and pycodestyle.max-doc-length options in favor of the new line-width and pycodestyle.max-line-width options. The motivation behind the rename is that the new options better emphasize the fact that the unit is the unicode display width and not the characters per line.

I used this PR to change the diagnostic text for E501 and W505 to use the term width instead of characters in the diagnostic messages.

The old options act as aliases (including ruff check --line-length) until we decide to remove them for good. Ruff prints a warning when it detects the usage of a deprecated configuration option. The deprecated options remain visible on the website but are marked as deprecated. The same is true when showing the options with ruff config.

This PR doesn't yet rename tab-size because I'm yet undecided whether it should be tab-width or tab-spaces.

Closes #7574
Closes #7573

Considerations

We may want to consider holding off on this rename, considering that line-length is one of the most often used settings and the 0.1.0 was about stabilization. Deprecating the option is in line with our versioning policy (patch release is fine), but it may give the impression that Ruff isn't as stable as we claimed it to be with the 0.1 release.

Test Plan

Newly added integration tests.

Screenshot 2023-10-19 at 10 07 45 Screenshot 2023-10-19 at 10 07 35

@MichaReiser MichaReiser changed the base branch from formatter-respect-tab-size to options-deprecated October 18, 2023 07:51
@MichaReiser MichaReiser added configuration Related to settings and configuration cli Related to the command-line interface labels Oct 18, 2023
Comment on lines -388 to -394
/// Set the line-length.
#[arg(long, help_heading = "Rule configuration", hide = true)]
pub line_length: Option<LineLength>,
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this option from the formatter. I don't remember us explicitly deciding on exposing it and it was a hidden option anyway.

@MichaReiser MichaReiser marked this pull request as ready for review October 18, 2023 08:21
@MichaReiser MichaReiser force-pushed the options-deprecated branch 2 times, most recently from d601bfd to f5ddc5a Compare October 19, 2023 00:58
Base automatically changed from options-deprecated to main October 19, 2023 01:07
@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2023

PR Check Results

Ecosystem

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

rasa (+9, -9)

- data/test_classes/custom_graph_components/nlu_dense.py:115:89: E501 Line too long (95 > 88 characters)
+ data/test_classes/custom_graph_components/nlu_dense.py:115:89: E501 Line too long (95 > 88 width)
- data/test_classes/custom_graph_components/nlu_sparse.py:156:89: E501 Line too long (90 > 88 characters)
+ data/test_classes/custom_graph_components/nlu_sparse.py:156:89: E501 Line too long (90 > 88 width)
- data/test_classes/custom_slots.py:11:89: E501 Line too long (93 > 88 characters)
+ data/test_classes/custom_slots.py:11:89: E501 Line too long (93 > 88 width)
- scripts/evaluate_release_tag.py:14:89: E501 Line too long (106 > 88 characters)
+ scripts/evaluate_release_tag.py:14:89: E501 Line too long (106 > 88 width)
- scripts/evaluate_release_tag.py:43:89: E501 Line too long (120 > 88 characters)
+ scripts/evaluate_release_tag.py:43:89: E501 Line too long (120 > 88 width)
- scripts/evaluate_release_tag.py:57:89: E501 Line too long (94 > 88 characters)
+ scripts/evaluate_release_tag.py:57:89: E501 Line too long (94 > 88 width)
- scripts/prepare_nightly_release.py:81:89: E501 Line too long (95 > 88 characters)
+ scripts/prepare_nightly_release.py:81:89: E501 Line too long (95 > 88 width)
- scripts/prepare_nightly_release.py:89:89: E501 Line too long (103 > 88 characters)
+ scripts/prepare_nightly_release.py:89:89: E501 Line too long (103 > 88 width)
- scripts/release.py:315:89: E501 Line too long (99 > 88 characters)
+ scripts/release.py:315:89: E501 Line too long (99 > 88 width)

aws-sam-cli (+186, -186)

- tests/end_to_end/test_runtimes_e2e.py:23:121: E501 Line too long (121 > 120 characters)
+ tests/end_to_end/test_runtimes_e2e.py:23:121: E501 Line too long (121 > 120 width)
- tests/integration/buildcmd/build_integ_base.py:1051:121: E501 Line too long (128 > 120 characters)
+ tests/integration/buildcmd/build_integ_base.py:1051:121: E501 Line too long (128 > 120 width)
- tests/integration/buildcmd/build_integ_base.py:196:121: E501 Line too long (154 > 120 characters)
+ tests/integration/buildcmd/build_integ_base.py:196:121: E501 Line too long (154 > 120 width)
- tests/integration/buildcmd/build_integ_base.py:636:121: E501 Line too long (126 > 120 characters)
+ tests/integration/buildcmd/build_integ_base.py:636:121: E501 Line too long (126 > 120 width)
- tests/integration/buildcmd/test_build_cmd.py:2339:121: E501 Line too long (125 > 120 characters)
+ tests/integration/buildcmd/test_build_cmd.py:2339:121: E501 Line too long (125 > 120 width)
- tests/integration/buildcmd/test_build_cmd.py:2554:121: E501 Line too long (125 > 120 characters)
+ tests/integration/buildcmd/test_build_cmd.py:2554:121: E501 Line too long (125 > 120 width)
- tests/integration/buildcmd/test_build_terraform_applications_other_cases.py:422:121: E501 Line too long (136 > 120 characters)
+ tests/integration/buildcmd/test_build_terraform_applications_other_cases.py:422:121: E501 Line too long (136 > 120 width)
- tests/integration/delete/test_delete_command.py:21:121: E501 Line too long (121 > 120 characters)
+ tests/integration/delete/test_delete_command.py:21:121: E501 Line too long (121 > 120 width)
- tests/integration/deploy/test_deploy_command.py:18:121: E501 Line too long (121 > 120 characters)
+ tests/integration/deploy/test_deploy_command.py:18:121: E501 Line too long (121 > 120 width)
- tests/integration/deploy/test_deploy_command.py:753:121: E501 Line too long (125 > 120 characters)
+ tests/integration/deploy/test_deploy_command.py:753:121: E501 Line too long (125 > 120 width)
- tests/integration/deploy/test_managed_stack_deploy.py:16:121: E501 Line too long (121 > 120 characters)
+ tests/integration/deploy/test_managed_stack_deploy.py:16:121: E501 Line too long (121 > 120 width)
- tests/integration/deploy/test_managed_stack_deploy.py:17:121: E501 Line too long (121 > 120 characters)
+ tests/integration/deploy/test_managed_stack_deploy.py:17:121: E501 Line too long (121 > 120 width)
- tests/integration/init/schemas/schemas_test_data_setup.py:174:121: E501 Line too long (159 > 120 characters)
+ tests/integration/init/schemas/schemas_test_data_setup.py:174:121: E501 Line too long (159 > 120 width)
- tests/integration/init/schemas/schemas_test_data_setup.py:181:121: E501 Line too long (142 > 120 characters)
+ tests/integration/init/schemas/schemas_test_data_setup.py:181:121: E501 Line too long (142 > 120 width)
- tests/integration/init/schemas/schemas_test_data_setup.py:190:121: E501 Line too long (159 > 120 characters)
+ tests/integration/init/schemas/schemas_test_data_setup.py:190:121: E501 Line too long (159 > 120 width)
- tests/integration/init/schemas/schemas_test_data_setup.py:191:121: E501 Line too long (132 > 120 characters)
+ tests/integration/init/schemas/schemas_test_data_setup.py:191:121: E501 Line too long (132 > 120 width)
- tests/integration/init/test_init_command.py:499:121: E501 Line too long (155 > 120 characters)
+ tests/integration/init/test_init_command.py:499:121: E501 Line too long (155 > 120 width)
- tests/integration/local/invoke/test_integrations_cli.py:1095:121: E501 Line too long (143 > 120 characters)
+ tests/integration/local/invoke/test_integrations_cli.py:1095:121: E501 Line too long (143 > 120 width)
- tests/integration/local/invoke/test_integrations_cli.py:19:121: E501 Line too long (125 > 120 characters)
+ tests/integration/local/invoke/test_integrations_cli.py:19:121: E501 Line too long (125 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:213:121: E501 Line too long (160 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:213:121: E501 Line too long (160 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:248:121: E501 Line too long (160 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:248:121: E501 Line too long (160 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:283:121: E501 Line too long (160 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:283:121: E501 Line too long (160 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:318:121: E501 Line too long (160 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_cfn_authorizer_definitions.py:318:121: E501 Line too long (160 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:181:121: E501 Line too long (170 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:181:121: E501 Line too long (170 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:222:121: E501 Line too long (170 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:222:121: E501 Line too long (170 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:263:121: E501 Line too long (170 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:263:121: E501 Line too long (170 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:303:121: E501 Line too long (170 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:303:121: E501 Line too long (170 > 120 width)
- tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:344:121: E501 Line too long (170 > 120 characters)
+ tests/integration/local/start_api/lambda_authorizers/test_swagger_authorizer_definitions.py:344:121: E501 Line too long (170 > 120 width)
- tests/integration/local/start_lambda/test_start_lambda.py:268:121: E501 Line too long (134 > 120 characters)
+ tests/integration/local/start_lambda/test_start_lambda.py:268:121: E501 Line too long (134 > 120 width)
- tests/integration/package/test_package_command_image.py:18:121: E501 Line too long (123 > 120 characters)
+ tests/integration/package/test_package_command_image.py:18:121: E501 Line too long (123 > 120 width)
- tests/integration/package/test_package_command_zip.py:15:121: E501 Line too long (123 > 120 characters)
+ tests/integration/package/test_package_command_zip.py:15:121: E501 Line too long (123 > 120 width)
- tests/integration/package/test_package_command_zip.py:326:121: E501 Line too long (122 > 120 characters)
+ tests/integration/package/test_package_command_zip.py:326:121: E501 Line too long (122 > 120 width)
- tests/integration/publish/test_command_integ.py:17:121: E501 Line too long (123 > 120 characters)
+ tests/integration/publish/test_command_integ.py:17:121: E501 Line too long (123 > 120 width)
- tests/integration/sync/test_sync_code.py:29:121: E501 Line too long (121 > 120 characters)
+ tests/integration/sync/test_sync_code.py:29:121: E501 Line too long (121 > 120 width)
- tests/integration/sync/test_sync_infra.py:25:121: E501 Line too long (121 > 120 characters)
+ tests/integration/sync/test_sync_infra.py:25:121: E501 Line too long (121 > 120 width)
- tests/integration/sync/test_sync_watch.py:38:121: E501 Line too long (121 > 120 characters)
+ tests/integration/sync/test_sync_watch.py:38:121: E501 Line too long (121 > 120 width)
- tests/integration/testdata/sync/code/before/makefile_function_create_new_file/main.py:12:121: E501 Line too long (128 > 120 characters)
+ tests/integration/testdata/sync/code/before/makefile_function_create_new_file/main.py:12:121: E501 Line too long (128 > 120 width)
- tests/integration/validate/test_validate_command.py:24:121: E501 Line too long (121 > 120 characters)
+ tests/integration/validate/test_validate_command.py:24:121: E501 Line too long (121 > 120 width)
- tests/regression/deploy/test_deploy_regression.py:15:121: E501 Line too long (126 > 120 characters)
+ tests/regression/deploy/test_deploy_regression.py:15:121: E501 Line too long (126 > 120 width)
- tests/regression/deploy/test_deploy_regression.py:16:121: E501 Line too long (123 > 120 characters)
+ tests/regression/deploy/test_deploy_regression.py:16:121: E501 Line too long (123 > 120 width)
- tests/regression/package/test_package_regression.py:7:121: E501 Line too long (126 > 120 characters)
+ tests/regression/package/test_package_regression.py:7:121: E501 Line too long (126 > 120 width)
- tests/regression/package/test_package_regression.py:8:121: E501 Line too long (123 > 120 characters)
+ tests/regression/package/test_package_regression.py:8:121: E501 Line too long (123 > 120 width)
- tests/smoke/download_sar_templates.py:26:121: E501 Line too long (139 > 120 characters)
+ tests/smoke/download_sar_templates.py:26:121: E501 Line too long (139 > 120 width)
- tests/smoke/test_all_commands.py:59:121: E501 Line too long (121 > 120 characters)
+ tests/smoke/test_all_commands.py:59:121: E501 Line too long (121 > 120 width)
- tests/unit/cli/test_import_module_proxy.py:37:121: E501 Line too long (178 > 120 characters)
+ tests/unit/cli/test_import_module_proxy.py:37:121: E501 Line too long (178 > 120 width)
- tests/unit/commands/_utils/test_template.py:125:121: E501 Line too long (124 > 120 characters)
+ tests/unit/commands/_utils/test_template.py:125:121: E501 Line too long (124 > 120 width)
- tests/unit/commands/deploy/core/test_command.py:54:121: E501 Line too long (123 > 120 characters)
+ tests/unit/commands/deploy/core/test_command.py:54:121: E501 Line too long (123 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:144:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:144:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:215:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:215:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:294:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:294:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:414:121: E501 Line too long (121 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:414:121: E501 Line too long (121 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:418:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:418:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:497:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:497:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:656:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:656:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:710:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:710:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:774:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:774:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:833:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:833:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:89:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:89:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:903:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:903:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/deploy/test_guided_context.py:978:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/deploy/test_guided_context.py:978:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/init/test_cli.py:1681:121: E501 Line too long (143 > 120 characters)
+ tests/unit/commands/init/test_cli.py:1681:121: E501 Line too long (143 > 120 width)
- tests/unit/commands/init/test_cli.py:1827:121: E501 Line too long (134 > 120 characters)
+ tests/unit/commands/init/test_cli.py:1827:121: E501 Line too long (134 > 120 width)
- tests/unit/commands/init/test_cli.py:1875:121: E501 Line too long (138 > 120 characters)
+ tests/unit/commands/init/test_cli.py:1875:121: E501 Line too long (138 > 120 width)
- tests/unit/commands/init/test_cli.py:2412:121: E501 Line too long (150 > 120 characters)
+ tests/unit/commands/init/test_cli.py:2412:121: E501 Line too long (150 > 120 width)
- tests/unit/commands/init/test_cli.py:570:121: E501 Line too long (125 > 120 characters)
+ tests/unit/commands/init/test_cli.py:570:121: E501 Line too long (125 > 120 width)
- tests/unit/commands/init/test_cli.py:614:121: E501 Line too long (129 > 120 characters)
+ tests/unit/commands/init/test_cli.py:614:121: E501 Line too long (129 > 120 width)
- tests/unit/commands/list/endpoints/test_endpoints_context.py:180:121: E501 Line too long (121 > 120 characters)
+ tests/unit/commands/list/endpoints/test_endpoints_context.py:180:121: E501 Line too long (121 > 120 width)
- tests/unit/commands/list/endpoints/test_endpoints_context.py:267:121: E501 Line too long (157 > 120 characters)
+ tests/unit/commands/list/endpoints/test_endpoints_context.py:267:121: E501 Line too long (157 > 120 width)
- tests/unit/commands/list/endpoints/test_endpoints_context.py:279:121: E501 Line too long (157 > 120 characters)
+ tests/unit/commands/list/endpoints/test_endpoints_context.py:279:121: E501 Line too long (157 > 120 width)
- tests/unit/commands/list/endpoints/test_endpoints_context.py:79:121: E501 Line too long (157 > 120 characters)
+ tests/unit/commands/list/endpoints/test_endpoints_context.py:79:121: E501 Line too long (157 > 120 width)
- tests/unit/commands/list/endpoints/test_endpoints_context.py:937:121: E501 Line too long (754 > 120 characters)
+ tests/unit/commands/list/endpoints/test_endpoints_context.py:937:121: E501 Line too long (754 > 120 width)
- tests/unit/commands/list/endpoints/test_endpoints_context.py:984:121: E501 Line too long (1267 > 120 characters)
+ tests/unit/commands/list/endpoints/test_endpoints_context.py:984:121: E501 Line too long (1267 > 120 width)
- tests/unit/commands/list/resources/test_resources_context.py:155:121: E501 Line too long (619 > 120 characters)
+ tests/unit/commands/list/resources/test_resources_context.py:155:121: E501 Line too long (619 > 120 width)
- tests/unit/commands/list/resources/test_resources_context.py:186:121: E501 Line too long (615 > 120 characters)
+ tests/unit/commands/list/resources/test_resources_context.py:186:121: E501 Line too long (615 > 120 width)
- tests/unit/commands/list/resources/test_resources_context.py:292:121: E501 Line too long (669 > 120 characters)
+ tests/unit/commands/list/resources/test_resources_context.py:292:121: E501 Line too long (669 > 120 width)
- tests/unit/commands/list/resources/test_resources_context.py:87:121: E501 Line too long (157 > 120 characters)
+ tests/unit/commands/list/resources/test_resources_context.py:87:121: E501 Line too long (157 > 120 width)
- tests/unit/commands/list/stack_outputs/test_stack_outputs_context.py:26:121: E501 Line too long (130 > 120 characters)
+ tests/unit/commands/list/stack_outputs/test_stack_outputs_context.py:26:121: E501 Line too long (130 > 120 width)
- tests/unit/commands/local/cli_common/test_invoke_context.py:207:121: E501 Line too long (126 > 120 characters)
+ tests/unit/commands/local/cli_common/test_invoke_context.py:207:121: E501 Line too long (126 > 120 width)
- tests/unit/commands/local/lib/test_cfn_api_provider.py:1135:121: E501 Line too long (185 > 120 characters)
+ tests/unit/commands/local/lib/test_cfn_api_provider.py:1135:121: E501 Line too long (185 > 120 width)
- tests/unit/commands/local/lib/test_cfn_api_provider.py:1137:121: E501 Line too long (138 > 120 characters)
+ tests/unit/commands/local/lib/test_cfn_api_provider.py:1137:121: E501 Line too long (138 > 120 width)
- tests/unit/commands/local/lib/test_cfn_api_provider.py:784:121: E501 Line too long (122 > 120 characters)
+ tests/unit/commands/local/lib/test_cfn_api_provider.py:784:121: E501 Line too long (122 > 120 width)
- tests/unit/commands/local/lib/test_cfn_api_provider.py:809:121: E501 Line too long (122 > 120 characters)
+ tests/unit/commands/local/lib/test_cfn_api_provider.py:809:121: E501 Line too long (122 > 120 width)
- tests/unit/commands/local/lib/test_sam_function_provider.py:117:121: E501 Line too long (157 > 120 characters)
+ tests/unit/commands/local/lib/test_sam_function_provider.py:117:121: E501 Line too long (157 > 120 width)
- tests/unit/commands/local/lib/test_sam_function_provider.py:430:121: E501 Line too long (121 > 120 characters)
+ tests/unit/commands/local/lib/test_sam_function_provider.py:430:121: E501 Line too long (121 > 120 width)
- tests/unit/commands/local/lib/test_sam_function_provider.py:514:121: E501 Line too long (157 > 120 characters)
+ tests/unit/commands/local/lib/test_sam_function_provider.py:514:121: E501 Line too long (157 > 120 width)
- tests/unit/commands/local/lib/test_sam_function_provider.py:586:121: E501 Line too long (124 > 120 characters)
+ tests/unit/commands/local/lib/test_sam_function_provider.py:586:121: E501 Line too long (124 > 120 width)
- tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:231:121: E501 Line too long (136 > 120 characters)
+ tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:231:121: E501 Line too long (136 > 120 width)
- tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:245:121: E501 Line too long (130 > 120 characters)
+ tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:245:121: E501 Line too long (130 > 120 width)
- tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:64:121: E501 Line too long (124 > 120 characters)
+ tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:64:121: E501 Line too long (124 > 120 width)
- tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:76:121: E501 Line too long (162 > 120 characters)
+ tests/unit/commands/local/lib/validators/test_lambda_auth_props.py:76:121: E501 Line too long (162 > 120 width)
- tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:168:121: E501 Line too long (134 > 120 characters)
+ tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:168:121: E501 Line too long (134 > 120 width)
- tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:228:121: E501 Line too long (134 > 120 characters)
+ tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:228:121: E501 Line too long (134 > 120 width)
- tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:504:121: E501 Line too long (128 > 120 characters)
+ tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:504:121: E501 Line too long (128 > 120 width)
- tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:582:121: E501 Line too long (128 > 120 characters)
+ tests/unit/commands/pipeline/init/test_initeractive_init_flow.py:582:121: E501 Line too long (128 > 120 width)
- tests/unit/commands/remote/invoke/core/test_command.py:58:121: E501 Line too long (127 > 120 characters)
+ tests/unit/commands/remote/invoke/core/test_command.py:58:121: E501 Line too long (127 > 120 width)
- tests/unit/commands/remote/invoke/core/test_command.py:65:121: E501 Line too long (140 > 120 characters)
+ tests/unit/commands/remote/invoke/core/test_command.py:65:121: E501 Line too long (140 > 120 width)
- tests/unit/commands/remote/invoke/core/test_command.py:72:121: E501 Line too long (121 > 120 characters)
+ tests/unit/commands/remote/invoke/core/test_command.py:72:121: E501 Line too long (121 > 120 width)
- tests/unit/commands/remote/test_event/core/test_command.py:106:121: E501 Line too long (124 > 120 characters)
+ tests/unit/commands/remote/test_event/core/test_command.py:106:121: E501 Line too long (124 > 120 width)
- tests/unit/commands/remote/test_event/core/test_command.py:113:121: E501 Line too long (143 > 120 characters)
+ tests/unit/commands/remote/test_event/core/test_command.py:113:121: E501 Line too long (143 > 120 width)
- tests/unit/commands/remote/test_event/core/test_command.py:120:121: E501 Line too long (158 > 120 characters)
+ tests/unit/commands/remote/test_event/core/test_command.py:120:121: E501 Line too long (158 > 120 width)
- tests/unit/commands/remote/test_event/core/test_command.py:127:121: E501 Line too long (158 > 120 characters)
+ tests/unit/commands/remote/test_event/core/test_command.py:127:121: E501 Line too long (158 > 120 width)
- tests/unit/commands/remote/test_event/core/test_command.py:232:121: E501 Line too long (134 > 120 characters)
+ tests/unit/commands/remote/test_event/core/test_command.py:232:121: E501 Line too long (134 > 120 width)
- tests/unit/commands/remote/test_event/core/test_command.py:55:121: E501 Line too long (144 > 120 characters)
+ tests/unit/commands/remote/test_event/core/test_command.py:55:121: E501 Line too long (144 > 120 width)
- tests/unit/commands/remote/test_event/core/test_command.py:62:121: E501 Line too long (131 > 120 characters)
+ tests/unit/commands/remote/test_event/core/test_command.py:62:121: E501 Line too long (131 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1014:121: E501 Line too long (121 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1014:121: E501 Line too long (121 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1015:121: E501 Line too long (136 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1015:121: E501 Line too long (136 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1023:121: E501 Line too long (132 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1023:121: E501 Line too long (132 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1026:121: E501 Line too long (132 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1026:121: E501 Line too long (132 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1027:121: E501 Line too long (124 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1027:121: E501 Line too long (124 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1063:121: E501 Line too long (139 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1063:121: E501 Line too long (139 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1072:121: E501 Line too long (139 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1072:121: E501 Line too long (139 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1100:121: E501 Line too long (121 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1100:121: E501 Line too long (121 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1109:121: E501 Line too long (139 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1109:121: E501 Line too long (139 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1113:121: E501 Line too long (146 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1113:121: E501 Line too long (146 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1122:121: E501 Line too long (139 > 120 characters)
+ tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1122:121: E501 Line too long (139 > 120 width)
- tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py:1126:121: E501 Line too long (146 > 120 characters)
+ 

@MichaReiser MichaReiser requested review from charliermarsh and zanieb and removed request for charliermarsh and zanieb October 19, 2023 23:13
Comment on lines +120 to +121
"max-line-length" | "max_line_length" => match LineWidth::from_str(value) {
Ok(line_length) => options.line_width = Some(line_length),
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming that the line_length here wasn't renamed because it's coming from flake8?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, these are the options of the source configuration that gets rewritten to ruff.

Comment on lines 180 to 183
#[allow(deprecated)]
if args.line_length.is_some() {
warn_user_once!("The option `--line-length` has been renamed to `--line-width` to emphasize that the limit is the display width of a line and not the number of characters. Use the option `--line-width` instead.");
}
Copy link
Member

Choose a reason for hiding this comment

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

Do you think it would be useful to specify when the option will be removed in the deprecation message? Like "This option will be removed in v0.3.0". It could also help us in finding the deprecated features which needs to be removed before bumping the version.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think I have enough historical data yet to make a good prediction. Like removing it in 0.3 would be too early if we happen to release it in the coming weeks.

crates/ruff_workspace/src/options.rs Show resolved Hide resolved
#[option(
default = "88",
value_type = "int",
example = r#"
# Allow lines to be as long as 120 characters.
# Allow lines to have a width up to 120.
Copy link
Member

Choose a reason for hiding this comment

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

nit: for consistency

Suggested change
# Allow lines to have a width up to 120.
# Allow lines to have a display width up to 120.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I might actually go the other way round and use the simpler term width everywhere.

crates/ruff_workspace/src/options.rs Show resolved Hide resolved
@MichaReiser
Copy link
Member Author

@charliermarsh do you want to review this PR (it touches documentation ;)) or are you okay with me merging it.

Signed-off-by: Micha Reiser <micha@reiser.io>
@charliermarsh
Copy link
Member

@MichaReiser - Yes, I will review today!

@charliermarsh
Copy link
Member

I support using width over length conceptually, and I support renaming these to reflect it, but I am wondering if we should wait until v0.2.0 to release this change (as hinted at in your PR summary). The main question for me is: what's the cost of keeping this PR open? How painful would it be to defer this change until v0.2.0?

@MichaReiser
Copy link
Member Author

I support using width over length conceptually, and I support renaming these to reflect it, but I am wondering if we should wait until v0.2.0 to release this change (as hinted at in your PR summary). The main question for me is: what's the cost of keeping this PR open? How painful would it be to defer this change until v0.2.0?

The cost isn't too high. I only expect conflicts with your documentation PR. The question is how far off is the 0.2.0 release? Does that mean we should also hold back with the other configuration changes (like renaming tab-size to indent-width? Only shipping some of the deprecations feels inconsistent to me (it also leads to less consistent option naming: indent-width but line-length).

I think we should discuss this in the broader picture. Our versioning policy is clear that deprecating options is fine in a patch release. I don't mind holding off, but I think we should then consider changing our version policy as well.

@charliermarsh
Copy link
Member

Good questions, though I don't think it's inconsistent with our versioning policy to hold off for a bit. I actually don't care if it's 0.2.0 or some later patch release -- I'm more focused on the cadence of the changes. There are still decisions to make within the confines of the policy. Like, under the policy, we could also just ship a minor release every day with breaking changes, and that would be fine too, but we obviously wouldn't want to do that :)

Maybe I'm just over-analyzing the degree to which this will impact users. I do think a lot of users will be confused by line-width over line-length, but it's not like line-length is going away, so it might be fine.

@MichaReiser
Copy link
Member Author

Maybe I'm just over-analyzing the degree to which this will impact users. I do think a lot of users will be confused by line-width over line-length, but it's not like line-length is going away, so it might be fine.

That's fair. But how does this get solved by deferring the deprecating? This would be a justification to either not rename the option or support both options as aliases.

Regarding a later patch release. I think that would be more confusing because the main reason is to align the options with the formatter. Shouldn't the changes be released with the formatter?

The work we would need to redo is making sure that we incorporate the documentation improvements that I made but with the old terminology

@@ -65,7 +65,7 @@ pub(crate) fn format_imports(
block: &Block,
comments: Vec<Comment>,
locator: &Locator,
line_length: LineLength,
line_length: LineWidth,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: should this be line_width?

@@ -45,7 +45,7 @@ pub(crate) fn format_import_from(
import_from: &ImportFromData,
comments: &CommentSet,
aliases: &[(AliasData, CommentSet)],
line_length: LineLength,
line_length: LineWidth,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: should this be line_width?

@@ -138,7 +138,7 @@ pub(crate) fn format_imports(
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
fn format_import_block(
block: ImportBlock,
line_length: LineLength,
line_length: LineWidth,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: should this be line_width?

/// limiting lines to 79 characters. By default, this rule enforces a limit
/// of 88 characters for compatibility with Black, though that limit is
/// configurable via the [`line-length`] setting.
/// limiting lines to 79 characters. By default, this rule enforces a [display-width](http://www.unicode.org/reports/tr11/#Overview)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: remove dash in display-width? There's no dash in the linked source. (Also, do you mind changing the link to https?)

@@ -64,7 +64,7 @@ impl Violation for DocLineTooLong {
#[derive_message_formats]
fn message(&self) -> String {
let DocLineTooLong(width, limit) = self;
format!("Doc line too long ({width} > {limit} characters)")
format!("Doc line too long ({width} > {limit} width)")
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if width makes sense at the end here because it's not a unit. E.g., (80 > 79 width) seems incorrect. Perhaps just (80 > 79)? Could (80 > 79 characters) be arguably fine to keep as-is, since the length is 79 single-width characters?

Copy link
Member

Choose a reason for hiding this comment

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

or "width 80 > max width 79" or "width 80 > 79" or "width of 80 > 79"

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't it a unit? I first used Unicode widths but it felt lengthy.

I already found the existing one confusing because 88 > 80 characters compares unitless 88 with 80 characters. I like @zanieb's suggestion. Or I would write it as 88 > 80 [width]. I think that's the notation we used in university to denote the unit

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

I think your response is correct, in that my concerns were fundamentally about this being confusing for users, and I was letting that leak into the timeline on which we shipped it out.

I do think that using "width" exposes some complexity to users that -- in the vast majority of cases -- they won't need to think about. The "number of characters" is an obvious concept, but the "width of a line" or the "width of a character" is not something that most people are familiar with. (The comment I made below about using (80 > 79 wide) vs. (80 > 79 characters) in the diagnostics is a symptom of this challenge.) This concern applies both to using width conceptually, and to using the "width" terminology.

But, having seen that Rustfmt and Prettier use the width terminology, I feel better about moving forward with it. And I trust your judgment that it's worth unifying the terminology with the underlying concept.

@MichaReiser
Copy link
Member Author

Replaced by #8150

@MichaReiser MichaReiser deleted the rename-length-options branch January 16, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command-line interface configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename pydocstyle.max-doc-length to max-doc-width Rename line-length to line-width
5 participants