Skip to content

Commit

Permalink
Fix highlighter typehints and use correct import path
Browse files Browse the repository at this point in the history
  • Loading branch information
ogenstad committed Jun 30, 2024
1 parent 320b229 commit b6eec15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/highlighter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from IPython.core.display import HTML
from IPython.core.magic import register_line_magic
from IPython.display import HTML
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_for_filename
Expand All @@ -17,7 +17,7 @@


@register_line_magic
def highlight_file(filename):
def highlight_file(filename: str) -> HTML:
lexer = get_lexer_for_filename(filename)

linenos = "inline"
Expand Down
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ ignore = [
"UP015", # Unnecessary open mode parameters
"UP032", # Use f-string instead of `format` call
"UP034", # Avoid extraneous parentheses
#"UP037", # Remove quotes from type annotation
]

[tool.ruff.format]
Expand All @@ -200,11 +199,6 @@ max-returns = 11
"A001", # Variable `copyright` is shadowing a Python builtin
]

"docs/highlighter.py" = [
"ANN001", # Missing type annotation for function argument
"ANN201", # Missing return type annotation for public function
]

"nornir/core/configuration.py" = [
"A002", # Argument `format` / `help` is shadowing a Python builtin
]
Expand Down

0 comments on commit b6eec15

Please sign in to comment.