feat(analyse): add Bash language support#92
Conversation
Add `bash` as a supported comment-type for marker extraction, discovering `.sh`, `.bash`, `.zsh` and `.ksh` files. Bash has only `#` line comments, so it reuses the existing hash-comment extraction path (BASH_QUERY + `function_definition` scope nodes) via a tree-sitter-bash grammar. A `default_oneliner_bash` case is added to the shared `oneline.yaml` extraction fixture with its captured snapshot, and the feature is documented under `FE_BASH`. Fish shell is intentionally excluded: no tree-sitter-fish grammar is published on PyPI, so it cannot be wired into this Python package. Closes #48
ReviewMust fix — the supported-styles table in Test coverage
Otherwise clean. Wiring is complete and consistent: enum + file-type map, query + |
… row The bash row was inserted between the JSONC row's last cell and its continuation line, so the mode-line example rendered inside the bash "discovered file types" cell and the JSONC cell lost it.
…ssociation
- shebang_oneliner_bash extraction fixture: the shebang comment yields no
marker or warning, the marker anchors to line 2, and `function name { }`
definitions parse
- test_find_associated_scope_bash: comments associate with the
function_definition for both definition syntaxes, including the
enclosing-scope fallback for comments inside a body
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
==========================================
+ Coverage 91.40% 91.46% +0.06%
==========================================
Files 34 34
Lines 3012 3034 +22
Branches 322 323 +1
==========================================
+ Hits 2753 2775 +22
Misses 160 160
Partials 99 99 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Review findings addressed in f604413 and fe82065:
Verified with the full tox suite (267 passed, 34 snapshots), mypy, and the pinned pre-commit hooks on the changed files; CI is green on fe82065. |
Adds
bashas a supportedcomment_typefor marker extraction. Closes #48.What
CommentType.bash, discovering.sh,.bash,.zshand.kshfiles.#line comments, so extraction reuses the existing hash-comment path: a(comment) @commenttree-sitter query over thetree-sitter-bashgrammar, withfunction_definitionscope nodes.tree-sitter-bash>=0.25.1dependency.Tests & docs
default_oneliner_bashcase in the sharedoneline.yamlextraction fixture, with its captured snapshot.FE_BASHfeature, with the configuration / analyse / changelog pages updated.Not included
Fish shell — it is not POSIX-compatible and no
tree-sitter-fishgrammar is published on PyPI, so it cannot be wired into this package. Can be revisited if a PyPI grammar becomes available.