-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[isort
] Check full module path against project root(s) when categorizing first-party
#16565
Open
dylwil3
wants to merge
3
commits into
astral-sh:main
Choose a base branch
from
dylwil3:namespaces
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+48
−15
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
I001 | 26 | 13 | 13 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+13 -13 violations, +0 -0 fixes in 4 projects; 51 projects unchanged)
Snowflake-Labs/snowcli (+10 -13 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview
+ 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/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/stage/diff.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/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/spcs/testing_utils/image_repository_utils.py:1: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/testing_utils/sql_utils.py:15:1: I001 [*] Import block is un-sorted or un-formatted
freedomofpress/securedrop (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview
+ journalist_gui/test_gui.py:1:1: I001 [*] Import block is un-sorted or un-formatted
mlflow/mlflow (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview
+ tests/projects/utils.py:50:5: I001 [*] Import block is un-sorted or un-formatted
pytest-dev/pytest (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview
+ 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 | 26 | 13 | 13 | 0 | 0 |
5cb8c06
to
2eb5cd5
Compare
isort
] Only infer subpackages of namespace packages as first-partyisort
] Check full module path against project root(s) when categorizing first-party
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When attempting to determine whether
import foo.bar.baz
is a known first-party import relative to user-provided source paths, we now check thatSRC/foo/bar/baz
is a directory orSRC/foo/bar/baz.py
orSRC/foo/bar/baz.pyi
exist.Previously, we just checked the analogous thing for
SRC/foo
, but this can be misleading in situations with disjoint namespace packages that share a common base name (e.g. we may be working inside the namespace packagefoo.buzz
and importingfoo.bar
from elsewhere).Supersedes #12987
Closes #12984