You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[t-linter](https://github.com/koxudaxi/t-linter) is a linter, formatter, and LSP server for Python template strings (PEP 750 t-strings). It uses the same Rust backends (`tstring-json`, `tstring-toml`, `tstring-yaml`) as this project for `check` and `format` operations.
613
+
614
+
## Installation
615
+
616
+
```bash
617
+
pip install t-linter
618
+
```
619
+
620
+
Or with uv:
621
+
622
+
```bash
623
+
uv add t-linter
624
+
```
625
+
626
+
## CLI usage
627
+
628
+
### Check templates for errors
629
+
630
+
Validate t-string templates in your Python files:
631
+
632
+
```bash
633
+
t-linter check file.py
634
+
t-linter check src/
635
+
```
636
+
637
+
Output format options:
638
+
639
+
```bash
640
+
t-linter check file.py --format human # default, human-readable
Use `--error-on-issues` to fail CI when problems are found:
646
+
647
+
```bash
648
+
t-linter check src/ --error-on-issues
649
+
```
650
+
651
+
### Format templates
652
+
653
+
Canonical formatting for JSON, YAML, and TOML template literals:
654
+
655
+
```bash
656
+
t-linter format file.py
657
+
t-linter format src/
658
+
```
659
+
660
+
Dry-run to see what would change without modifying files:
661
+
662
+
```bash
663
+
t-linter format --check file.py
664
+
```
665
+
666
+
Read from stdin:
667
+
668
+
```bash
669
+
cat file.py | t-linter format --stdin-filename file.py -
670
+
```
671
+
672
+
## LSP server
673
+
674
+
Start the built-in LSP server for real-time editor diagnostics and formatting:
675
+
676
+
```bash
677
+
t-linter lsp
678
+
```
679
+
680
+
The LSP provides:
681
+
682
+
- **Diagnostics** — syntax and semantic errors reported inline as you type
683
+
- **Formatting** — format-on-save or format-on-demand via your editor's formatting command
684
+
685
+
## VSCode integration
686
+
687
+
1. Install the binary:
688
+
689
+
```bash
690
+
pip install t-linter
691
+
```
692
+
693
+
2. Install the [t-linter extension](https://marketplace.visualstudio.com/items?itemName=koxudaxi.t-linter) from the VSCode marketplace.
694
+
695
+
3. Recommended: set `"python.languageServer": "None"` in VSCode settings to avoid conflicts with other Python language servers.
696
+
697
+
4. Optionally configure `t-linter.serverPath` in settings if the binary is not on your `PATH`.
698
+
699
+
## Other editors
700
+
701
+
Any editor that supports the Language Server Protocol can use `t-linter lsp`. Configure your editor to start `t-linter lsp` as the language server for Python files.
702
+
703
+
## Configuration
704
+
705
+
Configure t-linter via `pyproject.toml`:
706
+
707
+
```toml
708
+
[tool.t-linter]
709
+
extend-exclude = ["generated", "vendor"]
710
+
ignore-file = ".t-linterignore"
711
+
```
712
+
713
+
## How it works with tstring-structured-data
714
+
715
+
t-linter and tstring-structured-data share the same Rust parsing and formatting backends:
716
+
717
+
- **tstring-structured-data** is the **runtime library** — `render_data()` and `render_text()` parse and render templates at runtime
718
+
- **t-linter** is the **developer tooling** — `check` validates templates and `format` canonicalizes them at development time
719
+
720
+
For JSON, YAML, and TOML templates, t-linter uses:
721
+
722
+
- **Tree-sitter** for fast syntax highlighting (low-latency, no full parse)
723
+
- **Rust backends** (`tstring-json`, `tstring-yaml`, `tstring-toml`) for strict `check` and `format` operations
Copy file name to clipboardExpand all lines: docs/llms.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@
15
15
- [YAML](https://tstring-structured-data.koxudaxi.dev/usage/yaml/): The `yaml-tstring` package provides `render_data`, `render_text`, and `render_result` for YAML templates.
16
16
- [Error Handling](https://tstring-structured-data.koxudaxi.dev/usage/error-handling/): T-string backends catch errors that f-strings silently ignore and block injection by construction.
17
17
- [Profiles](https://tstring-structured-data.koxudaxi.dev/usage/profiles/): Each backend accepts an optional `profile` keyword argument to select the target spec version.
18
+
- [Editor Integration (t-linter)](https://tstring-structured-data.koxudaxi.dev/usage/editor-integration/): [t-linter](https://github.com/koxudaxi/t-linter) is a linter, formatter, and LSP server for Python template strings (PEP 750 t-strings). It uses th...
[t-linter](https://github.com/koxudaxi/t-linter) is a linter, formatter, and LSP server for Python template strings (PEP 750 t-strings). It uses the same Rust backends (`tstring-json`, `tstring-toml`, `tstring-yaml`) as this project for `check` and `format` operations.
4
+
5
+
## Installation
6
+
7
+
```bash
8
+
pip install t-linter
9
+
```
10
+
11
+
Or with uv:
12
+
13
+
```bash
14
+
uv add t-linter
15
+
```
16
+
17
+
## CLI usage
18
+
19
+
### Check templates for errors
20
+
21
+
Validate t-string templates in your Python files:
22
+
23
+
```bash
24
+
t-linter check file.py
25
+
t-linter check src/
26
+
```
27
+
28
+
Output format options:
29
+
30
+
```bash
31
+
t-linter check file.py --format human # default, human-readable
Use `--error-on-issues` to fail CI when problems are found:
37
+
38
+
```bash
39
+
t-linter check src/ --error-on-issues
40
+
```
41
+
42
+
### Format templates
43
+
44
+
Canonical formatting for JSON, YAML, and TOML template literals:
45
+
46
+
```bash
47
+
t-linter format file.py
48
+
t-linter format src/
49
+
```
50
+
51
+
Dry-run to see what would change without modifying files:
52
+
53
+
```bash
54
+
t-linter format --check file.py
55
+
```
56
+
57
+
Read from stdin:
58
+
59
+
```bash
60
+
cat file.py | t-linter format --stdin-filename file.py -
61
+
```
62
+
63
+
## LSP server
64
+
65
+
Start the built-in LSP server for real-time editor diagnostics and formatting:
66
+
67
+
```bash
68
+
t-linter lsp
69
+
```
70
+
71
+
The LSP provides:
72
+
73
+
-**Diagnostics** — syntax and semantic errors reported inline as you type
74
+
-**Formatting** — format-on-save or format-on-demand via your editor's formatting command
75
+
76
+
## VSCode integration
77
+
78
+
1. Install the binary:
79
+
80
+
```bash
81
+
pip install t-linter
82
+
```
83
+
84
+
2. Install the [t-linter extension](https://marketplace.visualstudio.com/items?itemName=koxudaxi.t-linter) from the VSCode marketplace.
85
+
86
+
3. Recommended: set`"python.languageServer": "None"`in VSCode settings to avoid conflicts with other Python language servers.
87
+
88
+
4. Optionally configure `t-linter.serverPath`in settings if the binary is not on your `PATH`.
89
+
90
+
## Other editors
91
+
92
+
Any editor that supports the Language Server Protocol can use `t-linter lsp`. Configure your editor to start `t-linter lsp` as the language server for Python files.
93
+
94
+
## Configuration
95
+
96
+
Configure t-linter via `pyproject.toml`:
97
+
98
+
```toml
99
+
[tool.t-linter]
100
+
extend-exclude = ["generated", "vendor"]
101
+
ignore-file = ".t-linterignore"
102
+
```
103
+
104
+
## How it works with tstring-structured-data
105
+
106
+
t-linter and tstring-structured-data share the same Rust parsing and formatting backends:
107
+
108
+
- **tstring-structured-data** is the **runtime library** — `render_data()` and `render_text()` parse and render templates at runtime
109
+
- **t-linter** is the **developer tooling** — `check` validates templates and `format` canonicalizes them at development time
110
+
111
+
For JSON, YAML, and TOML templates, t-linter uses:
112
+
113
+
- **Tree-sitter**for fast syntax highlighting (low-latency, no full parse)
114
+
- **Rust backends** (`tstring-json`, `tstring-yaml`, `tstring-toml`) for strict `check` and `format` operations
0 commit comments