-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Detect imports in src
layouts by default
#12848
Conversation
49564d1
to
6321410
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the ecosystem tests will provide some test coverage?
6321410
to
e990d8e
Compare
CodSpeed Performance ReportMerging #12848 will not alter performanceComparing Summary
|
e990d8e
to
77f03fd
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
I001 | 480 | 181 | 299 | 0 | 0 |
PLR6104 | 358 | 0 | 358 | 0 | 0 |
TCH001 | 18 | 18 | 0 | 0 | 0 |
TCH002 | 18 | 0 | 18 | 0 | 0 |
RUF101 | 3 | 3 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+199 -317 violations, +0 -0 fixes in 2 projects; 52 projects unchanged)
Snowflake-Labs/snowcli (+181 -2 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/snowflake/cli/_app/cli_app.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/commands_registration/command_plugins_loader.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/commands_registration/typer_registration.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/dev/docs/commands_docs_generator.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/dev/docs/generator.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/dev/docs/project_definition_docs_generator.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/loggers.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/main_typer.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/printing.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/snow_connector.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_app/telemetry.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_plugins/connection/commands.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_plugins/connection/util.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_plugins/cortex/commands.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_plugins/cortex/manager.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_plugins/git/commands.py:15:1: I001 [*] Import block is un-sorted or un-formatted + src/snowflake/cli/_plugins/init/commands.py:15:1: I001 [*] Import block is un-sorted or un-formatted ... 166 additional changes omitted for project
bokeh/bokeh (+18 -315 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- docs/bokeh/docserver.py:31:1: I001 [*] Import block is un-sorted or un-formatted - docs/bokeh/source/conf.py:9:1: I001 [*] Import block is un-sorted or un-formatted - docs/bokeh/source/docs/first_steps/examples/first_steps_5_vectorize_color_and_size.py:1:1: I001 [*] Import block is un-sorted or un-formatted - examples/advanced/extensions/wrapping.py:1:1: I001 [*] Import block is un-sorted or un-formatted - examples/advanced/integration/d3-voronoi.py:1:1: I001 [*] Import block is un-sorted or un-formatted - examples/basic/annotations/band.py:11:1: I001 [*] Import block is un-sorted or un-formatted - examples/basic/annotations/colorbar_log.py:9:1: I001 [*] Import block is un-sorted or un-formatted - examples/basic/annotations/legend.py:9:1: I001 [*] Import block is un-sorted or un-formatted - examples/basic/annotations/legend_label.py:1:1: I001 [*] Import block is un-sorted or un-formatted - examples/basic/annotations/legend_two_dimensions.py:9:1: I001 [*] Import block is un-sorted or un-formatted - examples/basic/annotations/legends_item_visibility.py:9:1: I001 [*] Import block is un-sorted or un-formatted ... 287 additional changes omitted for rule I001 + tests/integration/models/test_plot.py:27:28: TCH001 Move application import `bokeh.document.Document` into a type-checking block - tests/integration/models/test_plot.py:27:28: TCH002 Move third-party import `bokeh.document.Document` into a type-checking block + tests/integration/tools/test_box_edit_tool.py:24:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block - tests/integration/tools/test_box_edit_tool.py:24:49: TCH002 Move third-party import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block + tests/integration/tools/test_box_zoom_tool.py:21:30: TCH001 Move application import `bokeh.core.enums.DimensionsType` into a type-checking block - tests/integration/tools/test_box_zoom_tool.py:21:30: TCH002 Move third-party import `bokeh.core.enums.DimensionsType` into a type-checking block + tests/integration/tools/test_freehand_draw_tool.py:24:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block - tests/integration/tools/test_freehand_draw_tool.py:24:49: TCH002 Move third-party import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block + tests/integration/tools/test_pan_tool.py:21:30: TCH001 Move application import `bokeh.core.enums.DimensionsType` into a type-checking block - tests/integration/tools/test_pan_tool.py:21:30: TCH002 Move third-party import `bokeh.core.enums.DimensionsType` into a type-checking block + tests/integration/tools/test_point_draw_tool.py:24:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block - tests/integration/tools/test_point_draw_tool.py:24:49: TCH002 Move third-party import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block + tests/integration/tools/test_poly_draw_tool.py:24:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block - tests/integration/tools/test_poly_draw_tool.py:24:49: TCH002 Move third-party import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block + tests/integration/tools/test_poly_edit_tool.py:24:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block - tests/integration/tools/test_poly_edit_tool.py:24:49: TCH002 Move third-party import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block + tests/integration/widgets/test_autocomplete_input.py:25:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block - tests/integration/widgets/test_autocomplete_input.py:25:49: TCH002 Move third-party import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block + tests/integration/widgets/test_numeric_input.py:21:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block - tests/integration/widgets/test_numeric_input.py:21:49: TCH002 Move third-party import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block + tests/integration/widgets/test_password_input.py:21:49: TCH001 Move application import `bokeh.application.handlers.function.ModifyDoc` into a type-checking block ... 8 additional changes omitted for rule TCH001 ... 301 additional changes omitted for project
Changes by rule (3 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
I001 | 480 | 181 | 299 | 0 | 0 |
TCH001 | 18 | 18 | 0 | 0 | 0 |
TCH002 | 18 | 0 | 18 | 0 | 0 |
That's a lot of ecosystem changes, though I think they're correct / as-intended. |
Well, I guess it's not "a lot of ecosystem changes" -- it's ecosystem changes in two projects, and for projects that are effected, it's a lot of changes. |
Some of the changes also seem to be exclusively about the wording of the diagnostic and not that it is a different diagnostic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @charliermarsh
Do we also need to change
ruff/crates/ruff_linter/src/settings/mod.rs
Line 399 in 25f5a8b
src: vec![path_dedot::CWD.clone()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than @MichaReiser's comments
5ab77ae
to
b036a38
Compare
b036a38
to
c936eb8
Compare
## Summary Occasionally, we receive bug reports that imports in `src` directories aren't correctly detected. The root of the problem is that we default to `src = ["."]`, so users have to set `src = ["src"]` explicitly. This PR extends the default to cover _both_ of them: `src = [".", "src"]`. Closes #12454. ## Test Plan I replicated the structure described in #12453, and verified that the imports were considered sorted, but that adding `src = ["."]` showed an error.
## Summary Occasionally, we receive bug reports that imports in `src` directories aren't correctly detected. The root of the problem is that we default to `src = ["."]`, so users have to set `src = ["src"]` explicitly. This PR extends the default to cover _both_ of them: `src = [".", "src"]`. Closes #12454. ## Test Plan I replicated the structure described in #12453, and verified that the imports were considered sorted, but that adding `src = ["."]` showed an error.
## Summary Occasionally, we receive bug reports that imports in `src` directories aren't correctly detected. The root of the problem is that we default to `src = ["."]`, so users have to set `src = ["src"]` explicitly. This PR extends the default to cover _both_ of them: `src = [".", "src"]`. Closes #12454. ## Test Plan I replicated the structure described in #12453, and verified that the imports were considered sorted, but that adding `src = ["."]` showed an error.
Update to FAQ.md at https://github.com/astral-sh/ruff/blob/main/docs/faq.md is merited as a result of this change I think. Specifically, the following bullet can be removed:
|
Summary
Occasionally, we receive bug reports that imports in
src
directories aren't correctly detected. The root of the problem is that we default tosrc = ["."]
, so users have to setsrc = ["src"]
explicitly. This PR extends the default to cover both of them:src = [".", "src"]
.Closes #12454.
Test Plan
I replicated the structure described in #12453, and verified that the imports were considered sorted, but that adding
src = ["."]
showed an error.