Skip to content

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Sep 5, 2025

This stabilizes the behavior introduced in #16565 which (roughly) tries to match an import like import a.b.c to an actual directory path a/b/c in order to label it as first-party, rather than simply looking for a directory a.

Mainly this affects the sorting of imports in the presence of namespace packages, but a few other rules are affected as well.

Copy link
Contributor

github-actions bot commented Sep 5, 2025

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+22 -14 violations, +0 -0 fixes in 5 projects; 50 projects unchanged)

Snowflake-Labs/snowcli (+15 -14 violations, +0 -0 fixes)

+ scripts/cleanup.py:14: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/logs/manager.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/_plugins/logs/utils.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/_plugins/nativeapp/sf_sql_facade.py:14:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/_plugins/spcs/compute_pool/manager.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/_plugins/spcs/image_repository/manager.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/_plugins/sql/manager.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/_plugins/stage/diff.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/_plugins/streamlit/manager.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/api/cli_global_context.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/api/connections.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/api/entities/common.py:1:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/api/output/types.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ src/snowflake/cli/api/sql_execution.py:15:1: I001 [*] Import block is un-sorted or un-formatted
+ test_external_plugins/snowpark_hello_single_command/src/snowflakecli/test_plugins/snowpark_hello/manager.py:14:1: I001 [*] Import block is un-sorted or un-formatted
- tests/nativeapp/utils.py:15:1: I001 [*] Import block is un-sorted or un-formatted
- tests/test_data/projects/glob_patterns/main.py:1:1: I001 [*] Import block is un-sorted or un-formatted
- tests/test_data/projects/glob_patterns/src/app.py:1:1: I001 [*] Import block is un-sorted or un-formatted
- tests/test_data/projects/glob_patterns_zip/main.py:1:1: I001 [*] Import block is un-sorted or un-formatted
- tests/test_data/projects/glob_patterns_zip/src/app.py:1:1: I001 [*] Import block is un-sorted or un-formatted
- tests/test_main.py:17:1: I001 [*] Import block is un-sorted or un-formatted
- tests_integration/nativeapp/test_debug_mode.py:15:1: I001 [*] Import block is un-sorted or un-formatted
- tests_integration/nativeapp/test_telemetry_errors.py:14:1: I001 [*] Import block is un-sorted or un-formatted
- tests_integration/notebook/test_notebooks.py:15:1: I001 [*] Import block is un-sorted or un-formatted
- tests_integration/test_config.py:15:1: I001 [*] Import block is un-sorted or un-formatted
- tests_integration/test_data/projects/snowpark_artifact_repository/app.py:1:1: I001 [*] Import block is un-sorted or un-formatted
- tests_integration/testing_utils/sql_utils.py:15:1: I001 [*] Import block is un-sorted or un-formatted
- tests_integration/tests_using_container_services/spcs/testing_utils/image_repository_utils.py:1:1: I001 [*] Import block is un-sorted or un-formatted

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

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

+ airflow-core/docs/conf.py:21:1: I001 [*] Import block is un-sorted or un-formatted
+ chart/docs/conf.py:21:1: I001 [*] Import block is un-sorted or un-formatted
+ docker-stack-docs/conf.py:21:1: I001 [*] Import block is un-sorted or un-formatted
+ providers-summary-docs/conf.py:21:1: I001 [*] Import block is un-sorted or un-formatted

freedomofpress/securedrop (+1 -0 violations, +0 -0 fixes)

+ journalist_gui/test_gui.py:1:1: I001 [*] Import block is un-sorted or un-formatted

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

+ tests/projects/utils.py:50:5: I001 [*] Import block is un-sorted or un-formatted

pytest-dev/pytest (+1 -0 violations, +0 -0 fixes)

+ testing/_py/test_local.py:2:1: I001 [*] Import block is un-sorted or un-formatted

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
I001 36 22 14 0 0

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Thanks! I was slightly surprised to see a net increase in diagnostics, but I totally defer to your experience here. It looks like the same set from the original PR anyway.

@dylwil3 dylwil3 force-pushed the dylan/stabilize-match-source branch from 66ebfa2 to d528747 Compare September 5, 2025 20:42
@dylwil3
Copy link
Collaborator Author

dylwil3 commented Sep 5, 2025

Thanks! I was slightly surprised to see a net increase in diagnostics, but I totally defer to your experience here. It looks like the same set from the original PR anyway.

Yeah these are expected, mostly because folks presumably sorted using the "old" method already.

@dylwil3 dylwil3 merged commit 38340d8 into brent/0.13.0 Sep 5, 2025
34 checks passed
@dylwil3 dylwil3 deleted the dylan/stabilize-match-source branch September 5, 2025 20:56
@dylwil3 dylwil3 mentioned this pull request Sep 5, 2025
2 tasks
ntBre pushed a commit that referenced this pull request Sep 8, 2025
This stabilizes the behavior introduced in #16565 which (roughly) tries
to match an import like `import a.b.c` to an actual directory path
`a/b/c` in order to label it as first-party, rather than simply looking
for a directory `a`.

Mainly this affects the sorting of imports in the presence of namespace
packages, but a few other rules are affected as well.
@ntBre ntBre added rule Implementing or modifying a lint rule breaking Breaking API change labels Sep 8, 2025
ntBre pushed a commit that referenced this pull request Sep 10, 2025
This stabilizes the behavior introduced in #16565 which (roughly) tries
to match an import like `import a.b.c` to an actual directory path
`a/b/c` in order to label it as first-party, rather than simply looking
for a directory `a`.

Mainly this affects the sorting of imports in the presence of namespace
packages, but a few other rules are affected as well.
ntBre pushed a commit that referenced this pull request Sep 10, 2025
This stabilizes the behavior introduced in #16565 which (roughly) tries
to match an import like `import a.b.c` to an actual directory path
`a/b/c` in order to label it as first-party, rather than simply looking
for a directory `a`.

Mainly this affects the sorting of imports in the presence of namespace
packages, but a few other rules are affected as well.
ntBre pushed a commit that referenced this pull request Sep 10, 2025
This stabilizes the behavior introduced in #16565 which (roughly) tries
to match an import like `import a.b.c` to an actual directory path
`a/b/c` in order to label it as first-party, rather than simply looking
for a directory `a`.

Mainly this affects the sorting of imports in the presence of namespace
packages, but a few other rules are affected as well.
dcreager added a commit that referenced this pull request Sep 10, 2025
* main: (26 commits)
  Ignore deprecated rules unless selected by exact code (#20167)
  Stabilize adding future import via config option (#20277)
  [`flake8-errmsg`] Stabilize extending `raw-string-in-exception` (`EM101`) to support byte strings (#20273)
  Stabilize the remaining Airflow rules (#20250)
  [`flake8-bugbear`] Stabilize support for non-context-manager calls in `assert-raises-exception` (`B017`) (#20274)
  [`flake8-commas`] Stabilize support for trailing comma checks in type parameter lists (`COM812`, `COM819`) (#20275)
  [`pygrep_hooks`] Stabilize using`AsyncMock` methods in `invalid-mock-access` (`PGH005`) (#20272)
  Stabilize new strategy for classifying imports as first party (#20268)
  [`pylint`] Stabilize ignoring `__init__.py` for `useless-import-alias` (`PLC0414`) (#20271)
  [`pylint`] Stabilize adding U+061C to `bidirectional-unicode` (`PLE2502`) (#20276)
  [`flake8-simplify`] Stabilize fix safety of `multiple-with-statements` (`SIM117`) (#20270)
  Stabilize `pytest-raises-ambiguous-pattern` (`RUF043`) (#20253)
  Stabilize `f-string-number-format` (`FURB116`) (#20247)
  [`pyupgrade`] Remove `non-pep604-isinstance` (`UP038`) (#19156)
  [`pandas-vet`] Remove `pandas-df-variable-name` (`PD901`) (#19223)
  Remove deprecated macOS config file discovery (#19210)
  Stabilize `redundant-none-literal` (`PYI061`) (#20236)
  Stabilize `generic-not-last-base-class` (`PYI059`) (#20246)
  Stabilize `useless-class-metaclass-type` (`UP050`) (#20230)
  Stabilize `os-symlink` (`PTH211`) (#20229)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking API change rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants