robotcode-analyze 2.5.1__tar.gz → 2.6.0__tar.gz
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.
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/.gitignore +5 -1
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/PKG-INFO +4 -4
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/pyproject.toml +3 -3
- robotcode_analyze-2.6.0/src/robotcode/analyze/__version__.py +1 -0
- robotcode_analyze-2.6.0/src/robotcode/analyze/code/_models.py +30 -0
- robotcode_analyze-2.6.0/src/robotcode/analyze/code/_sarif.py +94 -0
- robotcode_analyze-2.6.0/src/robotcode/analyze/code/cli.py +1020 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/code/code_analyzer.py +13 -11
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/code/robot_framework_language_provider.py +9 -10
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/config.py +74 -17
- robotcode_analyze-2.5.1/src/robotcode/analyze/__version__.py +0 -1
- robotcode_analyze-2.5.1/src/robotcode/analyze/code/cli.py +0 -500
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/README.md +0 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/__init__.py +0 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/cache/cli.py +0 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/cli.py +0 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/code/diagnostics_context.py +0 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/code/language_provider.py +0 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/hooks.py +0 -0
- {robotcode_analyze-2.5.1 → robotcode_analyze-2.6.0}/src/robotcode/analyze/py.typed +0 -0
|
@@ -331,7 +331,7 @@ output.xml
|
|
|
331
331
|
bundled/libs
|
|
332
332
|
|
|
333
333
|
# robotframework
|
|
334
|
-
results/
|
|
334
|
+
/results/
|
|
335
335
|
|
|
336
336
|
# kilocode
|
|
337
337
|
.kilocode/
|
|
@@ -339,3 +339,7 @@ results/
|
|
|
339
339
|
# .agents
|
|
340
340
|
.agents/
|
|
341
341
|
skills-lock.json
|
|
342
|
+
.claude
|
|
343
|
+
|
|
344
|
+
# sarif files
|
|
345
|
+
/**/*.sarif.json
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: robotcode-analyze
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.6.0
|
|
4
4
|
Summary: RobotCode analyze plugin for Robot Framework
|
|
5
5
|
Project-URL: Homepage, https://robotcode.io
|
|
6
6
|
Project-URL: Donate, https://opencollective.com/robotcode
|
|
@@ -25,9 +25,9 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
25
25
|
Classifier: Topic :: Utilities
|
|
26
26
|
Classifier: Typing :: Typed
|
|
27
27
|
Requires-Python: >=3.10
|
|
28
|
-
Requires-Dist: robotcode
|
|
29
|
-
Requires-Dist: robotcode-
|
|
30
|
-
Requires-Dist: robotcode
|
|
28
|
+
Requires-Dist: robotcode-plugin==2.6.0
|
|
29
|
+
Requires-Dist: robotcode-robot==2.6.0
|
|
30
|
+
Requires-Dist: robotcode==2.6.0
|
|
31
31
|
Requires-Dist: robotframework>=5.0.0
|
|
32
32
|
Description-Content-Type: text/markdown
|
|
33
33
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.6.0"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Data models emitted by `robotcode analyze code` in non-text output formats.
|
|
2
|
+
|
|
3
|
+
All models inherit from `CamelSnakeMixin` so the JSON output uses camelCase
|
|
4
|
+
keys, consistent with the `discover` and `results` command families. The
|
|
5
|
+
per-file diagnostics use the LSP `Diagnostic` shape, which editor integrations
|
|
6
|
+
and CI recipes already understand.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from dataclasses import dataclass, field
|
|
10
|
+
from typing import Dict, List
|
|
11
|
+
|
|
12
|
+
from robotcode.core.lsp.types import Diagnostic
|
|
13
|
+
from robotcode.core.utils.dataclasses import CamelSnakeMixin
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class CodeAnalysisSummary(CamelSnakeMixin):
|
|
18
|
+
files: int = 0
|
|
19
|
+
errors: int = 0
|
|
20
|
+
warnings: int = 0
|
|
21
|
+
infos: int = 0
|
|
22
|
+
hints: int = 0
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class CodeAnalysisResult(CamelSnakeMixin):
|
|
27
|
+
# Keyed by source path (relative to the project root, or absolute when
|
|
28
|
+
# --full-paths is given). Workspace-level diagnostics use "." as key.
|
|
29
|
+
diagnostics: Dict[str, List[Diagnostic]] = field(default_factory=dict)
|
|
30
|
+
summary: CodeAnalysisSummary = field(default_factory=CodeAnalysisSummary)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""Minimal SARIF 2.1.0 object model for `robotcode analyze code`.
|
|
2
|
+
|
|
3
|
+
Only the subset of SARIF that we actually emit is modelled. All classes inherit
|
|
4
|
+
from `CamelSnakeMixin`, which turns snake_case fields into the camelCase keys
|
|
5
|
+
SARIF expects (`ruleId`, `physicalLocation`, `startLine`, …). Fields that are
|
|
6
|
+
not valid Python identifiers (`$schema`) use a `field(metadata={"alias": ...})`.
|
|
7
|
+
|
|
8
|
+
Spec: https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from dataclasses import dataclass, field
|
|
12
|
+
from typing import Dict, List, Optional
|
|
13
|
+
|
|
14
|
+
from robotcode.core.utils.dataclasses import CamelSnakeMixin
|
|
15
|
+
|
|
16
|
+
SARIF_VERSION = "2.1.0"
|
|
17
|
+
SARIF_SCHEMA = "https://json.schemastore.org/sarif-2.1.0.json"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass
|
|
21
|
+
class Message(CamelSnakeMixin):
|
|
22
|
+
text: str
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class ArtifactLocation(CamelSnakeMixin):
|
|
27
|
+
uri: str
|
|
28
|
+
uri_base_id: Optional[str] = None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass
|
|
32
|
+
class Region(CamelSnakeMixin):
|
|
33
|
+
# SARIF regions are 1-based for both line and column.
|
|
34
|
+
start_line: int
|
|
35
|
+
start_column: Optional[int] = None
|
|
36
|
+
end_line: Optional[int] = None
|
|
37
|
+
end_column: Optional[int] = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class PhysicalLocation(CamelSnakeMixin):
|
|
42
|
+
artifact_location: ArtifactLocation
|
|
43
|
+
region: Optional[Region] = None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass
|
|
47
|
+
class Location(CamelSnakeMixin):
|
|
48
|
+
physical_location: Optional[PhysicalLocation] = None
|
|
49
|
+
message: Optional[Message] = None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass
|
|
53
|
+
class ReportingDescriptor(CamelSnakeMixin):
|
|
54
|
+
"""A rule definition (tool.driver.rules[])."""
|
|
55
|
+
|
|
56
|
+
id: str
|
|
57
|
+
name: Optional[str] = None
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@dataclass
|
|
61
|
+
class Result(CamelSnakeMixin):
|
|
62
|
+
rule_id: str
|
|
63
|
+
message: Message
|
|
64
|
+
level: str = "warning" # error | warning | note | none
|
|
65
|
+
rule_index: Optional[int] = None
|
|
66
|
+
locations: Optional[List[Location]] = None
|
|
67
|
+
related_locations: Optional[List[Location]] = None
|
|
68
|
+
partial_fingerprints: Optional[Dict[str, str]] = None
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass
|
|
72
|
+
class ToolComponent(CamelSnakeMixin):
|
|
73
|
+
name: str
|
|
74
|
+
version: Optional[str] = None
|
|
75
|
+
information_uri: Optional[str] = None
|
|
76
|
+
rules: Optional[List[ReportingDescriptor]] = None
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@dataclass
|
|
80
|
+
class Tool(CamelSnakeMixin):
|
|
81
|
+
driver: ToolComponent
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@dataclass
|
|
85
|
+
class Run(CamelSnakeMixin):
|
|
86
|
+
tool: Tool
|
|
87
|
+
results: List[Result] = field(default_factory=list)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@dataclass
|
|
91
|
+
class SarifLog(CamelSnakeMixin):
|
|
92
|
+
runs: List[Run] = field(default_factory=list)
|
|
93
|
+
version: str = SARIF_VERSION
|
|
94
|
+
schema: str = field(default=SARIF_SCHEMA, metadata={"alias": "$schema"})
|