chore: add ruff formatter, .gitignore, and uv convention (#40)

* chore: add ruff formatter, .gitignore, and uv convention

- Add ruff as dev dependency with basic config
- Add PostToolUse hook to auto-run ruff on .py edits
- Create .gitignore to exclude __pycache__ and settings.local.json
- Document uv run convention in CLAUDE.md
- Add CLAUDE.md, .claude/settings.json, and skills
- Apply ruff formatting to existing Python files

* fix: address CR feedback on hooks and uv run convention

- Fix hooks to read file_path from stdin JSON via jq instead of
  nonexistent $CLAUDE_FILE env var
- Update CLAUDE.md commands to use uv run python3 consistently
- Update skills to use uv run for python/dedup commands
This commit is contained in:
2026-03-02 02:57:45 +02:00
committed by GitHub
parent 546369704e
commit 2001b9ac2a
10 changed files with 194 additions and 27 deletions

View File

@@ -31,7 +31,7 @@ def generate_readme(files: list[Path]) -> None:
contents += '<table style="text-align: center;width: 100%">\n'
for i in range(0, len(icons), PER_ROW):
chunk = icons[i:i + PER_ROW]
chunk = icons[i : i + PER_ROW]
contents += "<tr>\n"
for icon in chunk:
@@ -42,7 +42,7 @@ def generate_readme(files: list[Path]) -> None:
contents += (
f"<td style='width: {per_row_width}'>"
f"<img width='30' src=\"{encoded_path}\" "
f"alt=\"{display_path}\" title=\":{name}:\"></td>\n"
f'alt="{display_path}" title=":{name}:"></td>\n'
)
contents += "</tr>\n"
@@ -80,12 +80,12 @@ def generate_html(files: list[Path]) -> None:
)
sections.append(
f' <section data-group="{html.escape(header)}">\n'
f' <h2>{display_header}</h2>\n'
f" <h2>{display_header}</h2>\n"
f' <div class="grid">\n{chr(10).join(emoji_items)}\n </div>\n'
f' </section>'
f" </section>"
)
contents = f'''<!DOCTYPE html>
contents = f"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
@@ -208,17 +208,14 @@ def generate_html(files: list[Path]) -> None:
</script>
</body>
</html>
'''
"""
Path("index.html").write_text(contents, encoding="utf-8")
print(f"Generated index.html with {len(files)} emojis")
def main():
files = sorted(
f for f in EMOJI_DIR.iterdir()
if f.suffix.lower() in EXTENSIONS
)
files = sorted(f for f in EMOJI_DIR.iterdir() if f.suffix.lower() in EXTENSIONS)
if not files:
raise SystemExit("No images to continue with.")