]> xn--ix-yja.es Git - alex.git/commitdiff
Finish ruff cleanup
authoralex <alex@pdp7.net>
Sun, 16 Mar 2025 13:00:32 +0000 (14:00 +0100)
committeralexpdp7 <alex@corcoles.net>
Sun, 16 Mar 2025 13:01:27 +0000 (14:01 +0100)
Related to #376

blog/pyproject.toml
blog/src/blog/gemtext.py
blog/src/blog/html.py

index b1f9c3143713fbb226fd2c4bffcf50df42e4601d..6f4e9a350c649b463674946af068d40eb348ecd0 100644 (file)
@@ -36,10 +36,10 @@ build-backend = "hatchling.build"
 [tool.ruff.lint]
 select = ["ALL"]
 ignore = [
-   "E741",                        # Ambiguous variable name (single letter variable)
-   "ANN",                         # Missing type annotations
-   "D1",                          # Missing docstrings
-   "B011", "PT015", "S101",       # I am wrong in liking asserts, but I do
-   "COM812",                      # Trailing comma missing, incompatible with ruff format
-   "D400", "D415", "D212", "D205" # I like doctests without docstrings
+   "E741",                                 # Ambiguous variable name (single letter variable)
+   "ANN",                                  # Missing type annotations
+   "D1",                                   # Missing docstrings
+   "B011", "PT015", "S101",                # I am wrong in liking asserts, but I do
+   "COM812",                               # Trailing comma missing, incompatible with ruff format
+   "D400", "D415", "D212", "D205", "D402", # I like doctests without docstrings
 ]
index 43cffd2f80b12bfdd88aaaf773ef871228b336ad..f79be9eeafabf71b55b1f2532e46ff94ec9e1c4b 100644 (file)
@@ -125,7 +125,7 @@ class Link:
         assert Link.is_link(line)
         parts = line.split(None, 2)
         self.url = parts[1]
-        self.text = parts[2] if len(parts) > 2 else None
+        self.text = parts[2] if len(parts) > 2 else None  # noqa: PLR2004, > 2 "magic constant"
 
     @staticmethod
     def is_link(line: str):
index c51237ce3bcc66ba336e89d55334afb2a33058a9..19fe6ea12b28eba2fbe5aa3e2fe7491f1ad36810 100644 (file)
@@ -86,7 +86,7 @@ def html_template(*content, page_title=None, path, full):
     )
 
 
-def gemini_to_html(parsed):
+def gemini_to_html(parsed):  # noqa: C901, PLR0912, PLR0915
     i = 0
     result = []
     while i < len(parsed):