From b6eec15402a154fce79dcdabb1f464497c8cec10 Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Sun, 30 Jun 2024 12:54:59 +0200 Subject: [PATCH] Fix highlighter typehints and use correct import path --- docs/highlighter.py | 4 ++-- pyproject.toml | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/highlighter.py b/docs/highlighter.py index 5ece78a4..bb14693c 100644 --- a/docs/highlighter.py +++ b/docs/highlighter.py @@ -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 @@ -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" diff --git a/pyproject.toml b/pyproject.toml index 5ef74ddf..7686574d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] @@ -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 ]