Skip to main content

pyproject.toml: add my default ruff config

ID
3be8b87
date
2026-04-20 04:54:53+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
546b982
message
pyproject.toml: add my default ruff config
changed files
2 files, 22 additions, 1 deletion

Changed files

create_snippets.py (8594) → create_snippets.py (8738)

diff --git a/create_snippets.py b/create_snippets.py
index 7902c7f..7dd431f 100755
--- a/create_snippets.py
+++ b/create_snippets.py
@@ -1,4 +1,7 @@
 #!/usr/bin/env python3
+"""
+Create my snippet expansions for Alfred.
+"""
 
 import hashlib
 import json
@@ -8,6 +11,9 @@ import zipfile
 
 
 def read(name: str) -> str:
+    """
+    Return the contents of text file in the `expansions` folder.
+    """
     with open(os.path.join("expansions", name)) as infile:
         return infile.read()
 
@@ -276,7 +282,9 @@ SNIPPETS = {
 
     # I can never remember the order of args to this function,
     # so when I start typing it, add a comment to help me out.
-    "datetime.datetime.strp": "datetime.datetime.strptime({cursor})  # date_string, format",
+    "datetime.datetime.strp": (
+    "datetime.datetime.strptime({cursor})  "
+    "# date_string, format"),
 
     # =================
     # Obsidian snippets

pyproject.toml (0) → pyproject.toml (328)

diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..e452379
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,13 @@
+[project]
+name = "snippets"
+version = "1.0"
+
+[tool.ruff.lint]
+select = ["D", "E", "F"]
+ignore = [
+    "D200",  # unnecessary-multiline-docstring
+    "D203",  # incorrect-blank-line-before-class
+    "D205",  # missing-blank-line-after-summary
+    "D211",  # blank-line-before-class
+    "D212",  # multi-line-summary-first-line
+]