Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Jan 30, 2025
1 parent 5c27147 commit 43ca0e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions edb/tools/docs/edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,19 @@ def run(self):
node = d_nodes.container()
node['split-section'] = True
self.state.nested_parse(self.content, self.content_offset, node)

split_indexes = [
index for index,child in enumerate(node.children)
if isinstance(child, d_nodes.container)
and child.get('split-point') == True
index for index, child in enumerate(node.children)
if isinstance(child, d_nodes.container) and child.get('split-point')
]
if len(split_indexes) > 1:
raise Exception(
f'cannot have multiple edb:split-point\'s in edb:split-section'
)
blocks = (
node.children[:split_indexes[0]] if
node.children[split_indexes[0]].get('code-above') == True
else node.children[split_indexes[0]+1:]
node.children[split_indexes[0]].get('code-above')
else node.children[split_indexes[0] + 1:]
) if len(split_indexes) == 1 else [node.children[-1]]
if len(blocks) < 1:
raise Exception(
Expand All @@ -113,7 +112,7 @@ def run(self):
f'code block, code tabs, or image/figure'
)
return [node]


class EDBSplitPoint(d_rst.Directive):

Expand Down
6 changes: 3 additions & 3 deletions edb/tools/docs/go.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

from typing import Any, Dict

from docutils import nodes as d_nodes

from sphinx import addnodes as s_nodes
from sphinx import directives as s_directives
from sphinx import domains as s_domains
Expand Down Expand Up @@ -102,7 +100,7 @@ def handle_signature(self, sig, signode):

def add_target_and_index(self, name, sig, signode):
return super().add_target_and_index(name, sig, signode)


class GoMethodDirective(GoFunctionDirective):
pass
Expand Down Expand Up @@ -148,8 +146,10 @@ def get_full_qualified_name(self, node):
raise self.error('no fullname attribute')
return fn


def setup_domain(app):
app.add_domain(GolangDomain)


def setup(app):
setup_domain(app)

0 comments on commit 43ca0e9

Please sign in to comment.