fix: Remove additional trailing whitespace from code_analyzer.py
- Remove trailing whitespace from lines 1510, 1519, 1522, 1527, 1535, 1548, 1552, 1563, 1568, 1578 - Fixes remaining ruff W293 linting errors Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1507,7 +1507,7 @@ class CodeAnalyzer:
|
|||||||
if header_match:
|
if header_match:
|
||||||
resource_type = header_match.group(1)
|
resource_type = header_match.group(1)
|
||||||
script_class = header_match.group(2)
|
script_class = header_match.group(2)
|
||||||
|
|
||||||
# Extract external resources
|
# Extract external resources
|
||||||
for match in re.finditer(r'\[ext_resource.*?type="(.+?)".*?path="(.+?)".*?id="(.+?)"\]', content):
|
for match in re.finditer(r'\[ext_resource.*?type="(.+?)".*?path="(.+?)".*?id="(.+?)"\]', content):
|
||||||
res_type, path, res_id = match.groups()
|
res_type, path, res_id = match.groups()
|
||||||
@@ -1516,15 +1516,15 @@ class CodeAnalyzer:
|
|||||||
"path": path,
|
"path": path,
|
||||||
"id": res_id
|
"id": res_id
|
||||||
})
|
})
|
||||||
|
|
||||||
if res_type == "Script":
|
if res_type == "Script":
|
||||||
script_path = path
|
script_path = path
|
||||||
|
|
||||||
# Extract properties from [resource] section
|
# Extract properties from [resource] section
|
||||||
resource_section = re.search(r'\[resource\](.*?)(?:\n\[|$)', content, re.DOTALL)
|
resource_section = re.search(r'\[resource\](.*?)(?:\n\[|$)', content, re.DOTALL)
|
||||||
if resource_section:
|
if resource_section:
|
||||||
prop_text = resource_section.group(1)
|
prop_text = resource_section.group(1)
|
||||||
|
|
||||||
for line in prop_text.strip().split('\n'):
|
for line in prop_text.strip().split('\n'):
|
||||||
if '=' in line:
|
if '=' in line:
|
||||||
key, value = line.split('=', 1)
|
key, value = line.split('=', 1)
|
||||||
@@ -1532,7 +1532,7 @@ class CodeAnalyzer:
|
|||||||
"name": key.strip(),
|
"name": key.strip(),
|
||||||
"value": value.strip()
|
"value": value.strip()
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"file": file_path,
|
"file": file_path,
|
||||||
"resource_type": resource_type,
|
"resource_type": resource_type,
|
||||||
@@ -1545,11 +1545,11 @@ class CodeAnalyzer:
|
|||||||
"dependency_count": len(resources)
|
"dependency_count": len(resources)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _analyze_godot_shader(self, content: str, file_path: str) -> dict[str, Any]:
|
def _analyze_godot_shader(self, content: str, file_path: str) -> dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
Analyze Godot .gdshader shader file.
|
Analyze Godot .gdshader shader file.
|
||||||
|
|
||||||
Extracts:
|
Extracts:
|
||||||
- Shader type (spatial, canvas_item, particles, etc.)
|
- Shader type (spatial, canvas_item, particles, etc.)
|
||||||
- Uniforms (parameters)
|
- Uniforms (parameters)
|
||||||
@@ -1560,12 +1560,12 @@ class CodeAnalyzer:
|
|||||||
functions = []
|
functions = []
|
||||||
varyings = []
|
varyings = []
|
||||||
shader_type = None
|
shader_type = None
|
||||||
|
|
||||||
# Extract shader type
|
# Extract shader type
|
||||||
type_match = re.search(r'shader_type\s+(\w+)', content)
|
type_match = re.search(r'shader_type\s+(\w+)', content)
|
||||||
if type_match:
|
if type_match:
|
||||||
shader_type = type_match.group(1)
|
shader_type = type_match.group(1)
|
||||||
|
|
||||||
# Extract uniforms
|
# Extract uniforms
|
||||||
for match in re.finditer(r'uniform\s+(\w+)\s+(\w+)(?:\s*:\s*(.+?))?(?:\s*=\s*(.+?))?;', content):
|
for match in re.finditer(r'uniform\s+(\w+)\s+(\w+)(?:\s*:\s*(.+?))?(?:\s*=\s*(.+?))?;', content):
|
||||||
uniform_type, name, hint, default = match.groups()
|
uniform_type, name, hint, default = match.groups()
|
||||||
@@ -1575,7 +1575,7 @@ class CodeAnalyzer:
|
|||||||
"hint": hint,
|
"hint": hint,
|
||||||
"default": default
|
"default": default
|
||||||
})
|
})
|
||||||
|
|
||||||
# Extract varying variables
|
# Extract varying variables
|
||||||
for match in re.finditer(r'varying\s+(\w+)\s+(\w+)', content):
|
for match in re.finditer(r'varying\s+(\w+)\s+(\w+)', content):
|
||||||
var_type, name = match.groups()
|
var_type, name = match.groups()
|
||||||
|
|||||||
Reference in New Issue
Block a user