Skip to content

Commit

Permalink
fix with latest tree-sitter
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Zamarin <[email protected]>
  • Loading branch information
arthurzam committed May 17, 2024
1 parent c7ddf40 commit 9e40001
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies = [
"lazy-object-proxy",
"lxml",
"pathspec",
"tree-sitter>=0.21.0",
"tree-sitter>=0.22.2",
"tree-sitter-bash>=0.21.0",
"snakeoil~=0.10.8",
"pkgcore~=0.12.25",
Expand Down
5 changes: 2 additions & 3 deletions src/pkgcheck/bash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import tree_sitter_bash
from tree_sitter import Language, Parser, Query

lang = Language(tree_sitter_bash.language(), "bash")
lang = Language(tree_sitter_bash.language())
query = lang.query
parser = Parser()
parser.set_language(lang)
parser = Parser(language=lang)

# various parse tree queries
cmd_query = query("(command) @call")
Expand Down
2 changes: 1 addition & 1 deletion src/pkgcheck/checks/codingstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ class _UnquotedVariablesCheck(Check):

def _var_needs_quotes(self, pkg, node):
pnode = node.parent
while pnode != node:
while pnode is not None:
if pnode.type in self.node_types_ok:
return False
elif pnode.type == "command":
Expand Down

0 comments on commit 9e40001

Please sign in to comment.