|
2 | 2 | id: zsh_lint |
3 | 3 | title: 🔍 Zsh Lint |
4 | 4 | sidebar_position: 13 |
5 | | -description: A Zi-aware linter for Zsh configuration and scripting. |
| 5 | +description: A Go-based semantic analyzer for Zsh. |
6 | 6 | keywords: |
7 | 7 | - zsh-lint |
8 | 8 | - linter |
9 | | - - zi |
| 9 | + - zsh |
| 10 | + - go |
10 | 11 | --- |
11 | 12 |
|
12 | 13 | {/* @format */} |
13 | 14 |
|
14 | | -import Tabs from "@theme/Tabs"; |
15 | | -import TabItem from "@theme/TabItem"; |
| 15 | +## A Go-based semantic analyzer for Zsh |
16 | 16 |
|
17 | | -## Zi-aware Linter for Zsh scripting language |
18 | | - |
19 | | -`zsh-lint` is a powerful linter designed specifically for Zsh. It understands Zi-specific constructs and helps ensure your configuration and scripts are following best practices and are free of syntax errors. |
| 17 | +`zsh-lint` is being rebooted as a Go semantic analyzer for Zsh. It parses Zsh |
| 18 | +sources with a real grammar front end and reports problems. It currently |
| 19 | +operates as a **parser survey** — reporting which files the parser accepts — and |
| 20 | +does not implement lint rules yet. |
20 | 21 |
|
21 | 22 | ### <i class="fa-brands fa-github"></i> [z-shell/zsh-lint][] |
22 | 23 |
|
23 | 24 | ### Installation |
24 | 25 |
|
25 | | -<Tabs> |
26 | | - <TabItem value="zi" label="Zi" default> |
27 | | - |
28 | | -Add the following to your `.zshrc` file: |
29 | | - |
30 | | -```zsh title="~/.zshrc" |
31 | | -zi light z-shell/zui |
32 | | -zi light z-shell/zsh-lint |
| 26 | +```sh |
| 27 | +go install github.com/z-shell/zsh-lint/cmd/zsh-lint@latest |
33 | 28 | ``` |
34 | 29 |
|
35 | | -Note: `zsh-lint` requires [ZUI](zui) to be loaded as well. |
36 | | - |
37 | | - </TabItem> |
38 | | - <TabItem value="standalone" label="Standalone"> |
39 | | - |
40 | | -Clone the repository and source the plugin: |
| 30 | +### Usage |
41 | 31 |
|
42 | | -```shell title="~/.zshrc" |
43 | | -git clone https://github.com/z-shell/zsh-lint.git |
44 | | -source path/to/zsh-lint/zsh-lint.plugin.zsh |
| 32 | +```sh |
| 33 | +zsh-lint path/to/file.zsh another.zsh |
45 | 34 | ``` |
46 | 35 |
|
47 | | - </TabItem> |
48 | | -</Tabs> |
| 36 | +Each file gets an `OK`/`FAIL` line; failures include a greppable |
| 37 | +`path:line:col: message`. The exit code is `0` only if every file parsed. |
49 | 38 |
|
50 | 39 | {/* end-of-file */} |
51 | 40 | {/* links */} |
|
0 commit comments