@kernlang/review-python 4.1.1-canary.227.1.dcaa3f78 → 4.1.1-canary.228.1.41c150f2
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.
|
@@ -23,7 +23,7 @@ export function extractBackgroundTasks(root, source, filePath, nodes) {
|
|
|
23
23
|
return;
|
|
24
24
|
walkNodes(body, 'call', (callNode) => {
|
|
25
25
|
const fnNode = callNode.childForFieldName('function');
|
|
26
|
-
if (
|
|
26
|
+
if (fnNode?.type !== 'attribute')
|
|
27
27
|
return;
|
|
28
28
|
const obj = fnNode.childForFieldName('object');
|
|
29
29
|
const attr = fnNode.childForFieldName('attribute');
|
|
@@ -54,10 +54,10 @@ export function extractGuards(root, source, filePath, nodes) {
|
|
|
54
54
|
// Feeds the `auth-drift` cross-stack rule.
|
|
55
55
|
walkNodes(root, 'default_parameter', (node) => {
|
|
56
56
|
const val = node.childForFieldName('value');
|
|
57
|
-
if (
|
|
57
|
+
if (val?.type !== 'call')
|
|
58
58
|
return;
|
|
59
59
|
const func = val.childForFieldName('function');
|
|
60
|
-
if (
|
|
60
|
+
if (func?.text !== 'Depends')
|
|
61
61
|
return;
|
|
62
62
|
const args = val.childForFieldName('arguments');
|
|
63
63
|
if (!args)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kernlang/review-python",
|
|
3
|
-
"version": "4.1.1-canary.
|
|
3
|
+
"version": "4.1.1-canary.228.1.41c150f2",
|
|
4
4
|
"description": "Python concept mapper for kern review — tree-sitter based",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tree-sitter": "^0.25.0",
|
|
10
10
|
"tree-sitter-python": "^0.25.0",
|
|
11
|
-
"@kernlang/
|
|
12
|
-
"@kernlang/
|
|
11
|
+
"@kernlang/core": "4.1.1-canary.228.1.41c150f2",
|
|
12
|
+
"@kernlang/review": "4.1.1-canary.228.1.41c150f2"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"ts-morph": "^28.0.0",
|
|
@@ -31,7 +31,7 @@ export function extractBackgroundTasks(
|
|
|
31
31
|
|
|
32
32
|
walkNodes(body, 'call', (callNode) => {
|
|
33
33
|
const fnNode = callNode.childForFieldName('function');
|
|
34
|
-
if (
|
|
34
|
+
if (fnNode?.type !== 'attribute') return;
|
|
35
35
|
|
|
36
36
|
const obj = fnNode.childForFieldName('object');
|
|
37
37
|
const attr = fnNode.childForFieldName('attribute');
|
|
@@ -58,9 +58,9 @@ export function extractGuards(root: Parser.SyntaxNode, source: string, filePath:
|
|
|
58
58
|
// Feeds the `auth-drift` cross-stack rule.
|
|
59
59
|
walkNodes(root, 'default_parameter', (node) => {
|
|
60
60
|
const val = node.childForFieldName('value');
|
|
61
|
-
if (
|
|
61
|
+
if (val?.type !== 'call') return;
|
|
62
62
|
const func = val.childForFieldName('function');
|
|
63
|
-
if (
|
|
63
|
+
if (func?.text !== 'Depends') return;
|
|
64
64
|
const args = val.childForFieldName('arguments');
|
|
65
65
|
if (!args) return;
|
|
66
66
|
const posArg = args.namedChildren.find((c) => c.type === 'identifier' || c.type === 'attribute');
|