aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-05-17 17:58:43 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2024-05-17 17:58:43 +0300
commit9e40001a9e6239a270c3d58d4e375e156332b712 (patch)
tree2761e73144edac0044ac9733322afbb00fdf6525
parentwork on 0.10.30 (diff)
downloadpkgcheck-9e40001a9e6239a270c3d58d4e375e156332b712.tar.gz
pkgcheck-9e40001a9e6239a270c3d58d4e375e156332b712.tar.bz2
pkgcheck-9e40001a9e6239a270c3d58d4e375e156332b712.zip
fix with latest tree-sitter
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--pyproject.toml2
-rw-r--r--src/pkgcheck/bash/__init__.py5
-rw-r--r--src/pkgcheck/checks/codingstyle.py2
3 files changed, 4 insertions, 5 deletions
diff --git a/pyproject.toml b/pyproject.toml
index 45fe7213..7b737347 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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",
diff --git a/src/pkgcheck/bash/__init__.py b/src/pkgcheck/bash/__init__.py
index 6fe6a36e..0c8a7a13 100644
--- a/src/pkgcheck/bash/__init__.py
+++ b/src/pkgcheck/bash/__init__.py
@@ -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")
diff --git a/src/pkgcheck/checks/codingstyle.py b/src/pkgcheck/checks/codingstyle.py
index 63704e47..cfc7f8da 100644
--- a/src/pkgcheck/checks/codingstyle.py
+++ b/src/pkgcheck/checks/codingstyle.py
@@ -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":