8000 Complete stubs for `bleach` by sobolevn · Pull Request #9314 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Complete stubs for bleach #9314

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 28 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4375fb5
Mark `bleach` as complete
sobolevn Dec 1, 2022
49d8286
Fix CI
sobolevn Dec 1, 2022
b924759
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2022
146a810
Merge branch 'main' into mark-bleach
AlexWaygood Feb 19, 2023
18e31e5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 19, 2023
24e2ad3
Fix some obvious merge issues
AlexWaygood Feb 19, 2023
1b526fe
fix more mistakes when merging `main`
AlexWaygood Feb 19, 2023
198f6a6
Update linkifier.pyi
AlexWaygood Feb 19, 2023
22fd76e
Remove unused allowlist entries
AlexWaygood Feb 19, 2023
dc39112
Merge branch 'main' into mark-bleach
AlexWaygood Feb 21, 2023
3245722
Merge branch 'main' into mark-bleach
AlexWaygood Jul 22, 2023
c4767d5
Update stubs/bleach/METADATA.toml
AlexWaygood Jul 22, 2023
704cb27
Update stubs/bleach/bleach/html5lib_shim.pyi
AlexWaygood Jul 22, 2023
5950664
fix mypy
AlexWaygood Jul 22, 2023
c723045
Merge branch 'main' into mark-bleach
Avasam Nov 30, 2023
c9faed8
Post-merge remove bleach from pyrightconfig.stricter.json
Avasam Nov 30, 2023
7b72eef
Merge branch 'main' into mark-bleach
AlexWaygood Feb 5, 2024
96fc2c4
Merge branch 'main' of https://github.com/python/typeshed into mark-b…
Avasam Feb 20, 2024
c79dca1
Ran stubdefaulter
Avasam Feb 20, 2024
7723b65
Complete missing types
Avasam Feb 20, 2024
ea95d05
Address PR comments
Avasam Feb 20, 2024
a4ee82c
More PR comments
Avasam Feb 20, 2024
5a39614
Mark uppercase names as Final
Avasam Feb 20, 2024
3f865d3
Reduce allowlist entried and indicate possible runtime failure
Avasam Feb 21, 2024
5f48c83
typo
Avasam Feb 21, 2024
9c88154
Update stubs/html5lib/html5lib/_inputstream.pyi
Avasam Feb 21, 2024
e318888
Update stubs/bleach/bleach/html5lib_shim.pyi
Avasam Feb 21, 2024
c4aeaa5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
  • Loading branch information
pre-commit-ci[bot] committed Dec 1, 2022
commit b924759facd353c124e70bc9af7d9543551d254c
8 changes: 4 additions & 4 deletions stubs/bleach/bleach/html5lib_shim.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from collections.abc import Iterator, Iterable
from typing import Any
import re
from collections.abc import Iterable, Iterator
from typing import Any

# We don't re-export any `html5lib` types / values here, because they are not
# really public and may change at any time. This is just a helper module,
# import things directly from `html5lib` instead!
from html5lib import HTMLParser
from html5lib.serializer import HTMLSerializer
from html5lib._tokenizer import HTMLTokenizer
from html5lib._inputstream import HTMLUnicodeInputStream
from html5lib._tokenizer import HTMLTokenizer
from html5lib.serializer import HTMLSerializer

HTML_TAGS: list[str]
HTML_TAGS_BLOCK_LEVEL: frozenset[str]
Expand Down
10 changes: 8 additions & 2 deletions stubs/bleach/bleach/linkifier.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
from collections.abc import Container, Iterable, MutableMapping, Sequence, Iterator
from collections.abc import Container, Iterable, Iterator, Sequence
from re import Pattern
from typing import Any, Protocol
from typing_extensions import TypeAlias
Expand Down Expand Up @@ -48,7 +48,13 @@ class LinkifyFilter(Filter):
url_re: re.Pattern[str]
email_re: re.Pattern[str]
def __init__(
self, source: TreeWalker, callbacks: list[_Callback] = ..., skip_tags: Container[str] | None = ..., parse_email: bool = ..., url_re: re.Pattern[str] = ..., email_re: re.Pattern[str] = ...
self,
source: TreeWalker,
callbacks: list[_Callback] = ...,
skip_tags: Container[str] | None = ...,
parse_email: bool = ...,
url_re: re.Pattern[str] = ...,
email_re: re.Pattern[str] = ...,
) -> None: ...
def apply_callbacks(self, attrs: _Attrs, is_new: bool) -> _Attrs: ...
def extract_character_data(self, token_list: _Token) -> str: ...
Expand Down
7 changes: 4 additions & 3 deletions stubs/bleach/bleach/sanitizer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ from re import Pattern
from typing import Any
from typing_extensions import TypeAlias

from html5lib.filters.base import Filter
from html5lib.filters.sanitizer import Filter as SanitizerFilter
from html5lib.treewalkers.base import TreeWalker

from .css_sanitizer import CSSSanitizer
from .html5lib_shim import BleachHTMLParser, BleachHTMLSerializer
from .linkifier import _Token
from html5lib.filters.sanitizer import Filter as SanitizerFilter
from html5lib.filters.base import Filter
from html5lib.treewalkers.base import TreeWalker

ALLOWED_TAGS: list[str]
ALLOWED_ATTRIBUTES: dict[str, list[str]]
Expand Down
0