Skip to content

Commit

Permalink
add types for REs
Browse files Browse the repository at this point in the history
I ran `fastmod 'RE: Any$' 'RE: Pattern'`. I then fixed the imports. Then
I ran stubtest, which complained about a couple of those substitutions
(stubgen will also type as Any if something is a str expression or
alias).
  • Loading branch information
hauntsaninja committed Sep 25, 2020
1 parent a500b50 commit 8f2c0c5
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 52 deletions.
20 changes: 10 additions & 10 deletions third_party/2and3/markdown/blockprocessors.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

logger: Any

Expand All @@ -17,7 +17,7 @@ class BlockProcessor:
class ListIndentProcessor(BlockProcessor):
ITEM_TYPES: Any
LIST_TYPES: Any
INDENT_RE: Any
INDENT_RE: Pattern
def __init__(self, *args) -> None: ...
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
Expand All @@ -29,7 +29,7 @@ class CodeBlockProcessor(BlockProcessor):
def run(self, parent, blocks) -> None: ...

class BlockQuoteProcessor(BlockProcessor):
RE: Any
RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
def clean(self, line): ...
Expand All @@ -39,32 +39,32 @@ class OListProcessor(BlockProcessor):
STARTSWITH: str = ...
LAZY_OL: bool = ...
SIBLING_TAGS: Any
RE: Any
CHILD_RE: Any
INDENT_RE: Any
RE: Pattern
CHILD_RE: Pattern
INDENT_RE: Pattern
def __init__(self, parser) -> None: ...
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
def get_items(self, block): ...

class UListProcessor(OListProcessor):
TAG: str = ...
RE: Any
RE: Pattern
def __init__(self, parser) -> None: ...

class HashHeaderProcessor(BlockProcessor):
RE: Any
RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...

class SetextHeaderProcessor(BlockProcessor):
RE: Any
RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...

class HRProcessor(BlockProcessor):
RE: str = ...
SEARCH_RE: Any
SEARCH_RE: Pattern
match: Any
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/markdown/extensions/abbr.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.inlinepatterns import InlineProcessor
from markdown.preprocessors import Preprocessor

ABBR_REF_RE: Any
ABBR_REF_RE: Pattern

class AbbrExtension(Extension):
def extendMarkdown(self, md) -> None: ...
Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/markdown/extensions/admonition.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

from markdown.blockprocessors import BlockProcessor
from markdown.extensions import Extension
Expand All @@ -9,7 +9,7 @@ class AdmonitionExtension(Extension):
class AdmonitionProcessor(BlockProcessor):
CLASSNAME: str = ...
CLASSNAME_TITLE: str = ...
RE: Any
RE: Pattern
RE_SPACES: Any
def test(self, parent, block): ...
def run(self, parent, blocks) -> None: ...
Expand Down
10 changes: 5 additions & 5 deletions third_party/2and3/markdown/extensions/attr_list.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor
Expand All @@ -8,10 +8,10 @@ def isheader(elem): ...

class AttrListTreeprocessor(Treeprocessor):
BASE_RE: str = ...
HEADER_RE: Any
BLOCK_RE: Any
INLINE_RE: Any
NAME_RE: Any
HEADER_RE: Pattern
BLOCK_RE: Pattern
INLINE_RE: Pattern
NAME_RE: Pattern
def run(self, doc) -> None: ...
def assign_attrs(self, elem, attrs) -> None: ...
def sanitize_name(self, name): ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/markdown/extensions/def_list.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, Pattern

from markdown.blockprocessors import BlockProcessor, ListIndentProcessor
from markdown.extensions import Extension

class DefListProcessor(BlockProcessor):
RE: Any
NO_INDENT_RE: Any
RE: Pattern
NO_INDENT_RE: Pattern
def test(self, parent, block): ...
def run(self, parent, blocks): ...

Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/markdown/extensions/fenced_code.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
Expand All @@ -7,7 +7,7 @@ class FencedCodeExtension(Extension):
def extendMarkdown(self, md) -> None: ...

class FencedBlockPreprocessor(Preprocessor):
FENCED_BLOCK_RE: Any
FENCED_BLOCK_RE: Pattern
CODE_WRAP: str = ...
LANG_TAG: str = ...
checked_for_codehilite: bool = ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/markdown/extensions/footnotes.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.inlinepatterns import InlineProcessor
Expand All @@ -8,8 +8,8 @@ from markdown.treeprocessors import Treeprocessor

FN_BACKLINK_TEXT: Any
NBSP_PLACEHOLDER: Any
DEF_RE: Any
TABBED_RE: Any
DEF_RE: Pattern
TABBED_RE: Pattern
RE_REF_ID: Any

class FootnoteExtension(Extension):
Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/markdown/extensions/legacy_attrs.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

ATTR_RE: Any
ATTR_RE: Pattern

class LegacyAttrs(Treeprocessor):
def run(self, doc) -> None: ...
Expand Down
10 changes: 5 additions & 5 deletions third_party/2and3/markdown/extensions/meta.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor

log: Any
META_RE: Any
META_MORE_RE: Any
BEGIN_RE: Any
END_RE: Any
META_RE: Pattern
META_MORE_RE: Pattern
BEGIN_RE: Pattern
END_RE: Pattern

class MetaExtension(Extension):
md: Any
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/markdown/extensions/sane_lists.pyi
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from typing import Any
from typing import Any, Pattern

from markdown.blockprocessors import OListProcessor, UListProcessor
from markdown.extensions import Extension

class SaneOListProcessor(OListProcessor):
SIBLING_TAGS: Any
LAZY_OL: bool = ...
CHILD_RE: Any
CHILD_RE: Pattern
def __init__(self, parser) -> None: ...

class SaneUListProcessor(UListProcessor):
SIBLING_TAGS: Any
CHILD_RE: Any
CHILD_RE: Pattern
def __init__(self, parser) -> None: ...

class SaneListExtension(Extension):
Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/markdown/extensions/smarty.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.inlinepatterns import HtmlInlineProcessor
Expand All @@ -21,7 +21,7 @@ closingSingleQuotesRegex: Any
closingSingleQuotesRegex2: Any
remainingSingleQuotesRegex: str
remainingDoubleQuotesRegex: str
HTML_STRICT_RE: Any
HTML_STRICT_RE: str

class SubstituteTextPattern(HtmlInlineProcessor):
replace: Any
Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/markdown/extensions/toc.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, Pattern

from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

def slugify(value, separator): ...

IDCOUNT_RE: Any
IDCOUNT_RE: Pattern

def unique(id, ids): ...
def get_name(el): ...
Expand Down
6 changes: 3 additions & 3 deletions third_party/2and3/markdown/inlinepatterns.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ EM_STRONG2_RE: str
STRONG_EM_RE: str
STRONG_EM2_RE: str
STRONG_EM3_RE: str
LINK_RE: Any
LINK_RE: str
IMAGE_LINK_RE: str
REFERENCE_RE: Any
REFERENCE_RE: str
IMAGE_REFERENCE_RE: str
NOT_STRONG_RE: str
AUTOLINK_RE: str
Expand Down Expand Up @@ -115,7 +115,7 @@ class ImageInlineProcessor(LinkInlineProcessor):
def handleMatch(self, m, data): ... # type: ignore

class ReferenceInlineProcessor(LinkInlineProcessor):
NEWLINE_CLEANUP_RE: Any
NEWLINE_CLEANUP_RE: Pattern
RE_LINK: Any
def handleMatch(self, m, data): ... # type: ignore
def evalId(self, data, index, text): ...
Expand Down
4 changes: 2 additions & 2 deletions third_party/2and3/markdown/postprocessors.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

from . import util

Expand All @@ -15,6 +15,6 @@ class AndSubstitutePostprocessor(Postprocessor):
def run(self, text): ...

class UnescapePostprocessor(Postprocessor):
RE: Any
RE: Pattern
def unescape(self, m): ...
def run(self, text): ...
6 changes: 3 additions & 3 deletions third_party/2and3/markdown/preprocessors.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Pattern

from . import util

Expand All @@ -21,6 +21,6 @@ class HtmlBlockPreprocessor(Preprocessor):

class ReferencePreprocessor(Preprocessor):
TITLE: str = ...
RE: Any
TITLE_RE: Any
RE: Pattern
TITLE_RE: Pattern
def run(self, lines): ...
6 changes: 3 additions & 3 deletions third_party/2and3/markdown/util.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import namedtuple
from typing import Any, Optional
from typing import Any, Optional, Pattern

PY37: Any
__deprecated__: Any
Expand All @@ -8,10 +8,10 @@ STX: str
ETX: str
INLINE_PLACEHOLDER_PREFIX: Any
INLINE_PLACEHOLDER: Any
INLINE_PLACEHOLDER_RE: Any
INLINE_PLACEHOLDER_RE: Pattern
AMP_SUBSTITUTE: Any
HTML_PLACEHOLDER: Any
HTML_PLACEHOLDER_RE: Any
HTML_PLACEHOLDER_RE: Pattern
TAG_PLACEHOLDER: Any
INSTALLED_EXTENSIONS: Any
RTL_BIDI_RANGES: Any
Expand Down

0 comments on commit 8f2c0c5

Please sign in to comment.