-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add stubs for chevron
package
#7139
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
76eb398
Add stubs for `chevron` package
4a3c95e
Add missing return types to
2734f99
Add missing return types to `chevron.tokenizer`
124f59b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b32bc35
Improve type hints for `chevron.main`
006ac96
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 97b089c
Add `__all__` to `chevron.__init__`
faresbakhit 0c58691
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4c661b8
Fix kwargs type in `chevron.main.main`
faresbakhit fc695a3
Improve type hints for `chevron`
6f14a39
Fix import in `chevron.renderer`
52dace3
Remove unused import in `chevron.renderer`
a764b4e
Fix wrong argument type in `chevron.renderer.render`
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
version = "0.14.*" |
This file contains hidden or 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,5 @@ | ||
from .main import cli_main as cli_main, main as main | ||
from .renderer import render as render | ||
from .tokenizer import ChevronError as ChevronError | ||
|
||
__all__ = ["main", "render", "cli_main", "ChevronError"] |
This file contains hidden or 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,7 @@ | ||
from _typeshed import StrOrBytesPath | ||
from typing import Any | ||
|
||
_OpenFile = StrOrBytesPath | int | ||
|
||
def main(template: _OpenFile, data: _OpenFile | None = ..., **kwargs: Any) -> str: ... | ||
def cli_main() -> None: ... |
This file contains hidden or 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 @@ | ||
version: str |
This file contains hidden or 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,17 @@ | ||
from _typeshed import StrPath, SupportsRead | ||
from typing import Any, MutableSequence, Sequence | ||
|
||
g_token_cache: dict[str, list[tuple[str, str]]] # undocumented | ||
|
||
def render( | ||
template: SupportsRead[str] | str | Sequence[tuple[str, str]] = ..., | ||
data: dict[str, Any] = ..., | ||
partials_path: StrPath | None = ..., | ||
partials_ext: str = ..., | ||
partials_dict: dict[str, str] = ..., | ||
padding: str = ..., | ||
def_ldel: str | None = ..., | ||
def_rdel: str | None = ..., | ||
Akuli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
scopes: MutableSequence[int] | None = ..., | ||
warn: bool = ..., | ||
) -> str: ... |
This file contains hidden or 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,11 @@ | ||
from typing import Iterator | ||
|
||
class ChevronError(SyntaxError): ... | ||
|
||
def grab_literal(template: str, l_del: str | None) -> tuple[str, str]: ... # undocumented | ||
def l_sa_check(template: str, literal: str, is_standalone: bool) -> bool | None: ... # undocumented | ||
def r_sa_check(template: str, tag_type: str, is_standalone: bool) -> bool: ... # undocumented | ||
def parse_tag(template: str, l_del: str | None, r_del: str | None) -> tuple[tuple[str, str], str]: ... # undocumented | ||
def tokenize( | ||
template: str, def_ldel: str | None = ..., def_rdel: str | None = ... | ||
) -> Iterator[tuple[str, str]]: ... # undocumented |
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.
Uh oh!
There was an error while loading. Please reload this page.