uncomment-hermes-plugin 3.10.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uncomment_hermes_plugin/__init__.py +12 -0
- uncomment_hermes_plugin/hermes.py +24 -0
- uncomment_hermes_plugin/plugin.yaml +5 -0
- uncomment_hermes_plugin/skills/uncomment/SKILL.md +104 -0
- uncomment_hermes_plugin/skills/uncomment/index.md +10 -0
- uncomment_hermes_plugin/skills/uncomment/references/configuration.md +73 -0
- uncomment_hermes_plugin/skills/uncomment/references/library.md +40 -0
- uncomment_hermes_plugin-3.10.3.dist-info/METADATA +21 -0
- uncomment_hermes_plugin-3.10.3.dist-info/RECORD +11 -0
- uncomment_hermes_plugin-3.10.3.dist-info/WHEEL +4 -0
- uncomment_hermes_plugin-3.10.3.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
2
|
+
# Content-Hash: blake3:108dedcbe5c8f5d5ef009226493fbc1177125be18fe519ed65e26bc396133b3e
|
|
3
|
+
# Source-Hash: blake3:0935b1c74300d0f985a89bd38c3cfd9146d3b7832a514aca4b1d1a2f0db775ed
|
|
4
|
+
# Schema-Version: v1
|
|
5
|
+
|
|
6
|
+
"""Hermes Agent plugin package."""
|
|
7
|
+
|
|
8
|
+
from . import hermes
|
|
9
|
+
from .hermes import register
|
|
10
|
+
|
|
11
|
+
__version__ = "3.10.3"
|
|
12
|
+
__all__ = ["hermes", "register"]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
2
|
+
# Content-Hash: blake3:f0861e3a09f285cd65f5c91452dbe9269b3364f36d138b56dab9f1e5f972ba27
|
|
3
|
+
# Source-Hash: blake3:0935b1c74300d0f985a89bd38c3cfd9146d3b7832a514aca4b1d1a2f0db775ed
|
|
4
|
+
# Schema-Version: v1
|
|
5
|
+
|
|
6
|
+
"""Register the bundled read-only skill with Hermes Agent."""
|
|
7
|
+
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Protocol
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class SkillContext(Protocol):
|
|
13
|
+
"""The registration API provided by the Hermes plugin SDK."""
|
|
14
|
+
|
|
15
|
+
def register_skill(self, name: str, path: Path, description: str = "") -> None: ...
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def register(ctx: SkillContext) -> None:
|
|
19
|
+
"""Resolve skill bytes relative to the installed native plugin."""
|
|
20
|
+
ctx.register_skill(
|
|
21
|
+
"uncomment",
|
|
22
|
+
Path(__file__).parent / "skills/uncomment/SKILL.md",
|
|
23
|
+
"Inventory, preserve, lint and remove source comments with Uncomment.",
|
|
24
|
+
)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Inventory, preserve, lint and remove source comments using Uncomment's tree-sitter CLI or Rust library. Use for comment cleanup and preservation policies without changing comment-like text in strings.
|
|
3
|
+
name: uncomment
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: Goldziher
|
|
7
|
+
repository: https://github.com/Goldziher/uncomment
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
12
|
+
Content-Hash: blake3:0c7de78d48b93b3fbba0488c23059fea8b4e0ff49f7c1de07c8c7bbf8a3c24fa
|
|
13
|
+
Source-Hash: blake3:0935b1c74300d0f985a89bd38c3cfd9146d3b7832a514aca4b1d1a2f0db775ed
|
|
14
|
+
Schema-Version: v1
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
## Uncomment Source Comment Cleanup
|
|
18
|
+
|
|
19
|
+
Uncomment uses tree-sitter to find source comments. This skill targets Uncomment
|
|
20
|
+
3.10 and newer, including `scan`, `keep`, `lint` and the `--check` gate. Install the
|
|
21
|
+
CLI separately; this plugin provides instructions and has no MCP server.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cargo install uncomment --version '^3.10'
|
|
25
|
+
# Binary wrappers are available as uncomment-cli on npm and uncomment on PyPI.
|
|
26
|
+
uncomment --version
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Inspect and preview
|
|
30
|
+
|
|
31
|
+
Start with the paths the user selected. An ordinary removal invocation writes
|
|
32
|
+
files; `scan`, `--dry-run`, and `--check` let you inspect the planned cleanup.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uncomment scan src/ --only removable --format jsonl --output comments.jsonl
|
|
36
|
+
uncomment src/ --dry-run --diff
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Scan records contain `id`, `path`, `line`, `end_line`, `start_byte`, `end_byte`,
|
|
40
|
+
`kind`, `verdict` and `text`. Preserved records also include `reason`. Positions are
|
|
41
|
+
one-based lines and zero-based byte offsets. Use IDs to select comments; IDs survive
|
|
42
|
+
edits above a comment but depend on its path, exact text and occurrence index.
|
|
43
|
+
|
|
44
|
+
### Preserve selected comments
|
|
45
|
+
|
|
46
|
+
Use a plain comment marker for comments that must survive cleanup:
|
|
47
|
+
|
|
48
|
+
```rust
|
|
49
|
+
// This workaround must stay until the upstream fix ships. ~keep
|
|
50
|
+
// ~keep
|
|
51
|
+
/// Documentation that must survive --remove-doc.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
A standalone marker uses the language's plain comment token, such as `//` or `#`,
|
|
55
|
+
not a documentation prefix such as `///`. Quoted mentions of `~keep` are prose,
|
|
56
|
+
not active markers. Let `keep` handle block comments and docstrings so it can
|
|
57
|
+
place and verify the marker without editing their runtime contents.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
uncomment keep src/ --id 'ID_FROM_SCAN'
|
|
61
|
+
uncomment keep src/ --match 'workaround' --dry-run --diff
|
|
62
|
+
uncomment keep src/ --from selected-comments.jsonl
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`--from` marks every ID in the supplied JSON or JSONL records; select the records
|
|
66
|
+
first. Extra decision fields do not turn an ID into a rejection. Missing IDs fail
|
|
67
|
+
unless `--skip-missing` is explicitly requested.
|
|
68
|
+
|
|
69
|
+
### Apply cleanup or gate it
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
uncomment src/ --dry-run --diff
|
|
73
|
+
uncomment src/
|
|
74
|
+
uncomment --check src/ --format json
|
|
75
|
+
uncomment --check --changed-only --base origin/main .
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Defaults preserve TODO/FIXME, documentation, common lint directives and active
|
|
79
|
+
`~keep` markers. `--remove-todo`, `--remove-fixme` and `--remove-doc` opt into removing
|
|
80
|
+
those categories; `--ignore PATTERN` adds case-sensitive substring preservation.
|
|
81
|
+
`--no-default-ignores` disables the built-in preservation patterns.
|
|
82
|
+
|
|
83
|
+
The removal gate exits 0 when nothing would be removed, 1 when removable comments
|
|
84
|
+
exist, and 2 when inspection could not complete. Check reported file counts;
|
|
85
|
+
zero matched files are not evidence that the intended tree passed. In 3.10.3, a
|
|
86
|
+
missing input path can print an error and still exit 0, so also verify paths exist
|
|
87
|
+
and the report covers the expected files. Current main source builds reject a
|
|
88
|
+
missing explicit path with exit 2; that fix has not been released yet.
|
|
89
|
+
|
|
90
|
+
### Lint tag conventions
|
|
91
|
+
|
|
92
|
+
Tag linting removes nothing and is inactive until `[lint] enabled = true` is
|
|
93
|
+
configured. Use [configuration](references/configuration.md) for layering,
|
|
94
|
+
exclusions and rule settings.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
uncomment lint src/ --format json
|
|
98
|
+
uncomment lint src/ --fix --todo-key 'PROJECT-123'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Use `--fix` only when rewriting tag comments is part of the requested work.
|
|
102
|
+
The key must be a real issue key chosen for that project.
|
|
103
|
+
|
|
104
|
+
For read-only Rust integration, see [library usage](references/library.md).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
+
Content-Hash: blake3:f42f05d7c370b764780e3f369cbb5e6946ea4a6b7ff99106c59e97bdfcc8435d
|
|
4
|
+
Source-Hash: blake3:0935b1c74300d0f985a89bd38c3cfd9146d3b7832a514aca4b1d1a2f0db775ed
|
|
5
|
+
Schema-Version: v1
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
# Concepts
|
|
9
|
+
|
|
10
|
+
* [Uncomment Source Comment Cleanup](SKILL.md) - Inventory, preserve, lint and remove source comments using Uncomment's tree-sitter CLI or Rust library. Use for comment cleanup and preservation policies without changing comment-like text in strings.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
+
Content-Hash: blake3:ff5a20cc917540f9afd622ab89d697c603c90a3bbccc6240082b43bca9bf06c6
|
|
4
|
+
Source-Hash: blake3:0935b1c74300d0f985a89bd38c3cfd9146d3b7832a514aca4b1d1a2f0db775ed
|
|
5
|
+
Schema-Version: v1
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
# Configuration and CLI Selection
|
|
9
|
+
|
|
10
|
+
The preferred project file is `.uncomment.toml`. Generate it with
|
|
11
|
+
`uncomment init`; `--comprehensive` includes every option. Existing files are
|
|
12
|
+
protected unless `--force` is supplied.
|
|
13
|
+
|
|
14
|
+
```toml
|
|
15
|
+
[global]
|
|
16
|
+
remove_todos = false
|
|
17
|
+
remove_fixme = false
|
|
18
|
+
remove_docs = false
|
|
19
|
+
use_default_ignores = true
|
|
20
|
+
preserve_patterns = ["WORKAROUND", "Copyright", "License"]
|
|
21
|
+
exclude = ["generated/**", "vendor/**"]
|
|
22
|
+
|
|
23
|
+
[lint]
|
|
24
|
+
enabled = true
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Global options layer from built-in defaults to the platform global config, project
|
|
28
|
+
ancestor configs, the nearest project config, and CLI flags. `-c, --config FILE`
|
|
29
|
+
selects a single config instead of automatic discovery. `.uncommentrc.toml` and
|
|
30
|
+
`uncomment.toml` are deprecated fallbacks; new projects should use `.uncomment.toml`.
|
|
31
|
+
A directory containing multiple recognized names uses the highest-precedence one,
|
|
32
|
+
not a merge of those files.
|
|
33
|
+
|
|
34
|
+
The global config lives under the platform config directory: typically
|
|
35
|
+
`~/.config/uncomment/config.toml` on Linux and
|
|
36
|
+
`~/Library/Application Support/uncomment/config.toml` on macOS.
|
|
37
|
+
|
|
38
|
+
`preserve_patterns` and `--ignore` match case-sensitive substrings of an already
|
|
39
|
+
identified comment, not regular expressions over source code. Short patterns can
|
|
40
|
+
preserve more comments than intended. Use narrow patterns for a named convention.
|
|
41
|
+
|
|
42
|
+
## File selection
|
|
43
|
+
|
|
44
|
+
- Paths can name files, directories or globs. Quote globs when Uncomment should expand them.
|
|
45
|
+
- `.gitignore` is respected unless `--no-gitignore` is supplied.
|
|
46
|
+
- `--exclude GLOB` adds exclusions to `[global] exclude`.
|
|
47
|
+
- Nested Git repositories are skipped unless `--traverse-git-repos` is supplied.
|
|
48
|
+
- `-j, --threads N` selects workers; 0 uses all cores, and the default is 1.
|
|
49
|
+
- No `--language` or stdin mode is declared in the CLI; use source file extensions
|
|
50
|
+
or configured language registrations.
|
|
51
|
+
|
|
52
|
+
For branch gates, use `--changed-only --base REF` to restrict files, or
|
|
53
|
+
`--changed-lines --base REF` to restrict findings to changed lines. `--staged`
|
|
54
|
+
selects the index diff rather than the worktree diff.
|
|
55
|
+
|
|
56
|
+
## Tag linting
|
|
57
|
+
|
|
58
|
+
`[lint] enabled = true` activates the default tag rules. `uncomment lint` then
|
|
59
|
+
checks canonical tags and issue keys, including references to the current branch's
|
|
60
|
+
own issue key. Without this setting, matching files have no active tag policy.
|
|
61
|
+
|
|
62
|
+
```toml
|
|
63
|
+
[lint]
|
|
64
|
+
enabled = true
|
|
65
|
+
|
|
66
|
+
[lint.rules]
|
|
67
|
+
todo_missing_key = "error"
|
|
68
|
+
todo_self_reference = "warn"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`--baseline FILE` makes already-recorded violations informational;
|
|
72
|
+
`--write-baseline --baseline FILE` records the current violations and exits 0.
|
|
73
|
+
Use baselines only when the project intentionally accepts that existing debt.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
+
Content-Hash: blake3:c2b7c3bed8e321e5c3e141562df4cc9908f270936bd0dd786bbbdbb9f263394c
|
|
4
|
+
Source-Hash: blake3:0935b1c74300d0f985a89bd38c3cfd9146d3b7832a514aca4b1d1a2f0db775ed
|
|
5
|
+
Schema-Version: v1
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
# Rust Library Integration
|
|
9
|
+
|
|
10
|
+
```toml
|
|
11
|
+
[dependencies]
|
|
12
|
+
uncomment = "3.10"
|
|
13
|
+
anyhow = "1"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`Processor` and `ConfigManager` expose the same AST-based processing used by the
|
|
17
|
+
CLI. `process_file_with_config` reads the source and returns a `ProcessedFile`; it
|
|
18
|
+
does not write the processed bytes back.
|
|
19
|
+
|
|
20
|
+
```rust
|
|
21
|
+
use std::path::Path;
|
|
22
|
+
use uncomment::{Processor, config::ConfigManager};
|
|
23
|
+
|
|
24
|
+
fn preview() -> anyhow::Result<()> {
|
|
25
|
+
let manager = ConfigManager::new(Path::new("."))?;
|
|
26
|
+
let mut processor = Processor::new_with_config(&manager);
|
|
27
|
+
let result = processor.process_file_with_config(Path::new("src/lib.rs"), &manager, None)?;
|
|
28
|
+
println!("{}", result.processed_content);
|
|
29
|
+
Ok(())
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use `Processor::inspect` for individual comment records and preservation reasons,
|
|
34
|
+
or `Processor::plan_removals` for byte-range edits. Both accept source text, a path
|
|
35
|
+
and a `ResolvedConfig`. Preserve byte offsets; they are not character indices.
|
|
36
|
+
|
|
37
|
+
The CLI's `scan`, `keep`, `lint` and removal planner share this inspection surface,
|
|
38
|
+
so use it rather than implementing another comment detector with text matching.
|
|
39
|
+
The language pack is compiled into the binary; no runtime grammar download or
|
|
40
|
+
custom MCP server is part of this library API.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: uncomment-hermes-plugin
|
|
3
|
+
Version: 3.10.3
|
|
4
|
+
Summary: Inventory, preserve and remove source comments with AST parsing. Skills only; install the Uncomment CLI separately.
|
|
5
|
+
Project-URL: Repository, https://github.com/Goldziher/uncomment
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: code-cleanup,comments,linting,tree-sitter
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# uncomment Hermes plugin
|
|
12
|
+
|
|
13
|
+
Inventory, preserve and remove source comments with AST parsing. Skills only; install the Uncomment CLI separately.
|
|
14
|
+
|
|
15
|
+
Install this package in the same Python environment as Hermes Agent:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
python -m pip install uncomment-hermes-plugin
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Enable the plugin through Hermes Agent's plugin configuration. Available registrations depend on the plugin's authored Hermes adapter.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
uncomment_hermes_plugin/__init__.py,sha256=pQJ_pWq9Z1SYs4-BR6-IoS1ZJQlssyUCw9HyiY5HQkc,385
|
|
2
|
+
uncomment_hermes_plugin/hermes.py,sha256=8FjdeZkdrd2b6Ho84R5E7w2wIzVpFpTP9LmXw46O4JA,851
|
|
3
|
+
uncomment_hermes_plugin/plugin.yaml,sha256=EhWJkRlp9TNR52k-zdoXPzbF9XjoZTN1A3Mp50oer4k,206
|
|
4
|
+
uncomment_hermes_plugin/skills/uncomment/SKILL.md,sha256=59xIRqk-K-1U9AryiwxSXt8zS7hQEnp58JPMQW36fQE,4058
|
|
5
|
+
uncomment_hermes_plugin/skills/uncomment/index.md,sha256=76fgjUko6-6Bm9rw12TvFuV3_rn1orFt0KEzzWyfdd4,505
|
|
6
|
+
uncomment_hermes_plugin/skills/uncomment/references/configuration.md,sha256=PjqHBbs37hWjNNOIgQ_S8LNiGtnh2qjfcXnTichIlro,2875
|
|
7
|
+
uncomment_hermes_plugin/skills/uncomment/references/library.md,sha256=c5tSknk1eEISjkcDHlsov2nKTRDN4JerAI082tJUAh8,1466
|
|
8
|
+
uncomment_hermes_plugin-3.10.3.dist-info/METADATA,sha256=oSiW8PkCo_fpR7Ddao8gVFEL36asbV4ckNJGYzBYxYs,804
|
|
9
|
+
uncomment_hermes_plugin-3.10.3.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
10
|
+
uncomment_hermes_plugin-3.10.3.dist-info/entry_points.txt,sha256=CYsfRWn9nqXjQfqd77JQuYVDuFsFwNJAWGCtwXP5qp8,59
|
|
11
|
+
uncomment_hermes_plugin-3.10.3.dist-info/RECORD,,
|