commit:     9e40001a9e6239a270c3d58d4e375e156332b712
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May 17 14:58:43 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May 17 14:58:43 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=9e40001a

fix with latest tree-sitter

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 pyproject.toml                     | 2 +-
 src/pkgcheck/bash/__init__.py      | 5 ++---
 src/pkgcheck/checks/codingstyle.py | 2 +-
 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":

Reply via email to