-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect
__all__
imports when determining definition visibility (#4357)
- Loading branch information
1 parent
72e0ffc
commit 9158f13
Showing
5 changed files
with
190 additions
and
81 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
def public_func(): | ||
pass | ||
|
||
|
||
def private_func(): | ||
pass | ||
|
||
|
||
class PublicClass: | ||
class PublicNestedClass: | ||
pass | ||
|
||
|
||
class PrivateClass: | ||
pass | ||
|
||
|
||
__all__ = ("public_func", "PublicClass") |
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
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
34 changes: 34 additions & 0 deletions
34
crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__all.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
source: crates/ruff/src/rules/pydocstyle/mod.rs | ||
--- | ||
all.py:1:1: D100 Missing docstring in public module | ||
| | ||
1 | def public_func(): | ||
| D100 | ||
2 | pass | ||
| | ||
|
||
all.py:1:5: D103 Missing docstring in public function | ||
| | ||
1 | def public_func(): | ||
| ^^^^^^^^^^^ D103 | ||
2 | pass | ||
| | ||
|
||
all.py:9:7: D101 Missing docstring in public class | ||
| | ||
9 | class PublicClass: | ||
| ^^^^^^^^^^^ D101 | ||
10 | class PublicNestedClass: | ||
11 | pass | ||
| | ||
|
||
all.py:10:11: D106 Missing docstring in public nested class | ||
| | ||
10 | class PublicClass: | ||
11 | class PublicNestedClass: | ||
| ^^^^^^^^^^^^^^^^^ D106 | ||
12 | pass | ||
| | ||
|
||
|
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