Skip to content

Commit

Permalink
馃敡 pre-commit autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Feb 22, 2023
1 parent 4e89474 commit 9740e23
Show file tree
Hide file tree
Showing 28 changed files with 6 additions and 39 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ exclude: >
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.2
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear~=22.7]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v1.0.1
hooks:
- id: mypy
additional_dependencies: [mdurl]
1 change: 0 additions & 1 deletion markdown_it/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def arrayReplaceAt(src: list, pos: int, newElements: list) -> list:


def isValidEntityCode(c: int) -> bool:

# broken sequence
if c >= 0xD800 and c <= 0xDFFF:
return False
Expand Down
1 change: 0 additions & 1 deletion markdown_it/helpers/parse_link_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


def parseLinkLabel(state: StateInline, start: int, disableNested: bool = False) -> int:

labelEnd = -1
oldPos = state.pos
found = False
Expand Down
3 changes: 1 addition & 2 deletions markdown_it/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Renderer
try:
from typing import Protocol
except ImportError: # Python <3.8 doesn't have `Protocol` in the stdlib
from typing_extensions import Protocol # type: ignore[misc]
from typing_extensions import Protocol # type: ignore


class RendererProtocol(Protocol):
Expand Down Expand Up @@ -82,7 +82,6 @@ def render(
result = ""

for i, token in enumerate(tokens):

if token.type == "inline":
assert token.children is not None
result += self.renderInline(token.children, options, env)
Expand Down
2 changes: 0 additions & 2 deletions markdown_it/rules_block/blockquote.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):

LOGGER.debug(
"entering blockquote: %s, %s, %s, %s", state, startLine, endLine, silent
)
Expand Down Expand Up @@ -129,7 +128,6 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):
# for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
nextLine = startLine + 1
while nextLine < endLine:

# check if it's outdented, i.e. it's inside list item and indented
# less than said list item:
#
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def code(state: StateBlock, startLine: int, endLine: int, silent: bool = False):

LOGGER.debug("entering code: %s, %s, %s, %s", state, startLine, endLine, silent)

if state.sCount[startLine] - state.blkIndent < 4:
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/fence.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def fence(state: StateBlock, startLine: int, endLine: int, silent: bool):

LOGGER.debug("entering fence: %s, %s, %s, %s", state, startLine, endLine, silent)

haveEndMarker = False
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/heading.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def heading(state: StateBlock, startLine: int, endLine: int, silent: bool):

LOGGER.debug("entering heading: %s, %s, %s, %s", state, startLine, endLine, silent)

pos = state.bMarks[startLine] + state.tShift[startLine]
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/hr.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


def hr(state: StateBlock, startLine: int, endLine: int, silent: bool):

LOGGER.debug("entering hr: %s, %s, %s, %s", state, startLine, endLine, silent)

pos = state.bMarks[startLine] + state.tShift[startLine]
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/lheading.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


def lheading(state: StateBlock, startLine: int, endLine: int, silent: bool):

LOGGER.debug("entering lheading: %s, %s, %s, %s", state, startLine, endLine, silent)

level = None
Expand Down
4 changes: 0 additions & 4 deletions markdown_it/rules_block/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# Search `[-+*][\n ]`, returns next pos after marker on success
# or -1 on fail.
def skipBulletListMarker(state: StateBlock, startLine: int):

pos = state.bMarks[startLine] + state.tShift[startLine]
maximum = state.eMarks[startLine]

Expand All @@ -33,7 +32,6 @@ def skipBulletListMarker(state: StateBlock, startLine: int):
# Search `\d+[.)][\n ]`, returns next pos after marker on success
# or -1 on fail.
def skipOrderedListMarker(state: StateBlock, startLine: int):

start = state.bMarks[startLine] + state.tShift[startLine]
pos = start
maximum = state.eMarks[startLine]
Expand All @@ -59,7 +57,6 @@ def skipOrderedListMarker(state: StateBlock, startLine: int):

# /* 0 */ /* 9 */
if ch >= 0x30 and ch <= 0x39:

# List marker should have no more than 9 digits
# (prevents integer overflow in browsers)
if pos - start >= 10:
Expand Down Expand Up @@ -97,7 +94,6 @@ def markTightParagraphs(state: StateBlock, idx: int):


def list_block(state: StateBlock, startLine: int, endLine: int, silent: bool):

LOGGER.debug("entering list: %s, %s, %s, %s", state, startLine, endLine, silent)

isTerminatingParagraph = False
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/paragraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


def paragraph(state: StateBlock, startLine: int, endLine: int, silent: bool = False):

LOGGER.debug(
"entering paragraph: %s, %s, %s, %s", state, startLine, endLine, silent
)
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def reference(state: StateBlock, startLine, _endLine, silent):

LOGGER.debug(
"entering reference: %s, %s, %s, %s", state, startLine, _endLine, silent
)
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_block/state_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def __init__(
tokens: list[Token],
srcCharCode: tuple[int, ...] | None = None,
):

if srcCharCode is not None:
self._src = src
self.srcCharCode = srcCharCode
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_core/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


def block(state: StateCore) -> None:

if state.inlineMode:
token = Token("inline", "", 0)
token.content = state.src
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_core/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


def normalize(state: StateCore) -> None:

# Normalize newlines
string = NEWLINES_RE.sub("\n", state.src)

Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_core/smartquotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ def smartquotes(state: StateCore) -> None:
return

for token in state.tokens:

if token.type != "inline" or not QUOTE_RE.search(token.content):
continue
assert token.children is not None
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_inline/autolink.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def autolink(state: StateInline, silent: bool) -> bool:

pos = state.pos

if state.srcCharCode[pos] != 0x3C: # /* < */
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_inline/backticks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def backtick(state: StateInline, silent: bool) -> bool:

pos = state.pos
ch = state.srcCharCode[pos]

Expand Down
2 changes: 0 additions & 2 deletions markdown_it/rules_inline/balance_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def processDelimiters(state: StateInline, delimiters, *args):

openersBottom = {}
maximum = len(delimiters)

Expand Down Expand Up @@ -50,7 +49,6 @@ def processDelimiters(state: StateInline, delimiters, *args):
continue

if opener.open and opener.end < 0:

isOddMatch = False

# from spec:
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_inline/emphasis.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def tokenize(state: StateInline, silent: bool):


def _postProcess(state, delimiters):

i = len(delimiters) - 1
while i >= 0:
startDelim = delimiters[i]
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_inline/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def entity(state: StateInline, silent: bool):

pos = state.pos
maximum = state.posMax

Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_inline/html_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def isLetter(ch: int):


def html_inline(state: StateInline, silent: bool):

pos = state.pos

if not state.md.options.get("html", None):
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_inline/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def image(state: StateInline, silent: bool):

label = None
href = ""
oldPos = state.pos
Expand Down
1 change: 0 additions & 1 deletion markdown_it/rules_inline/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


def link(state: StateInline, silent: bool):

href = ""
title = ""
label = None
Expand Down
2 changes: 0 additions & 2 deletions markdown_it/rules_inline/strikethrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def tokenize(state: StateInline, silent: bool):


def _postProcess(state: StateInline, delimiters: list[Delimiter]):

loneMarkers = []
maximum = len(delimiters)

Expand Down Expand Up @@ -89,7 +88,6 @@ def _postProcess(state: StateInline, delimiters: list[Delimiter]):
state.tokens[endDelim.token - 1].type == "text"
and state.tokens[endDelim.token - 1].content == "~"
):

loneMarkers.append(endDelim.token - 1)

i += 1
Expand Down
1 change: 0 additions & 1 deletion markdown_it/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def convert_attrs(value: Any) -> Any:

@dc.dataclass(**DATACLASS_KWARGS)
class Token:

type: str
"""Type of the token (string, e.g. "paragraph_open")"""

Expand Down
1 change: 0 additions & 1 deletion tests/test_port/test_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


def test_ref_definitions():

md = MarkdownIt()
src = "[a]: abc\n\n[b]: xyz\n\n[b]: ijk"
env = {}
Expand Down

0 comments on commit 9740e23

Please sign in to comment.