forked from harvard-edge/cs249r_book
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
57 lines (50 loc) · 2.13 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
57 lines (50 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# TinyTorch Pre-commit Configuration
# =============================================================================
# CLI and module validation hooks for TinyTorch (markdown collapse, CLI docs).
#
# Not merged into the default hook set from the repo root: install with
# `pre-commit install` still uses only `/.pre-commit-config.yaml`. Run this
# file when you want TinyTorch-specific checks on top:
# cd tinytorch && pre-commit run --config .pre-commit-config.yaml --all-files
# =============================================================================
repos:
# ===========================================================================
# MARKDOWN FORMATTING
# ===========================================================================
- repo: local
hooks:
- id: collapse-blank-lines
name: "TinyTorch: Collapse extra blank lines"
description: "Replace 2+ consecutive blank lines with single blank line"
entry: python3 tools/dev/collapse_blank_lines.py
language: python
files: \.(md|py)$
pass_filenames: true
# ===========================================================================
# CLI DOCUMENTATION VALIDATORS
# ===========================================================================
- repo: local
hooks:
- id: validate-cli-docs
name: "TinyTorch: Validate CLI documentation"
description: "Ensure tito commands in docs match actual CLI"
entry: python3 tools/dev/validate_cli_docs.py
language: python
files: \.md$
pass_filenames: false
# ===========================================================================
# PYTHON CODE QUALITY
# ===========================================================================
# Uncomment to enable Python linting/formatting
# - repo: https://github.com/psf/black
# rev: 24.4.2
# hooks:
# - id: black
# name: "Format Python code"
# files: ^(src/|tinytorch/|tools/).*\.py$
# - repo: https://github.com/pycqa/isort
# rev: 5.13.2
# hooks:
# - id: isort
# name: "Sort imports"
# files: ^(src/|tinytorch/|tools/).*\.py$