robotcode-analyze 0.98.0__tar.gz → 0.99.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-0.98.0 → robotcode_analyze-0.99.0}/PKG-INFO +4 -4
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/pyproject.toml +3 -3
- robotcode_analyze-0.99.0/src/robotcode/analyze/__version__.py +1 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/cli.py +38 -6
- robotcode_analyze-0.98.0/src/robotcode/analyze/__version__.py +0 -1
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/.gitignore +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/LICENSE.txt +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/README.md +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/__init__.py +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/code_analyzer.py +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/config.py +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/diagnostics_context.py +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/hooks.py +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/language_provider.py +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/py.typed +0 -0
- {robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/robot_framework_language_provider.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: robotcode-analyze
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.99.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
|
|
@@ -24,9 +24,9 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
24
24
|
Classifier: Topic :: Utilities
|
|
25
25
|
Classifier: Typing :: Typed
|
|
26
26
|
Requires-Python: >=3.8
|
|
27
|
-
Requires-Dist: robotcode-plugin==0.
|
|
28
|
-
Requires-Dist: robotcode-robot==0.
|
|
29
|
-
Requires-Dist: robotcode==0.
|
|
27
|
+
Requires-Dist: robotcode-plugin==0.99.0
|
|
28
|
+
Requires-Dist: robotcode-robot==0.99.0
|
|
29
|
+
Requires-Dist: robotcode==0.99.0
|
|
30
30
|
Requires-Dist: robotframework>=4.1.0
|
|
31
31
|
Description-Content-Type: text/markdown
|
|
32
32
|
|
|
@@ -27,9 +27,9 @@ classifiers = [
|
|
|
27
27
|
]
|
|
28
28
|
dependencies = [
|
|
29
29
|
"robotframework>=4.1.0",
|
|
30
|
-
"robotcode-plugin==0.
|
|
31
|
-
"robotcode-robot==0.
|
|
32
|
-
"robotcode==0.
|
|
30
|
+
"robotcode-plugin==0.99.0",
|
|
31
|
+
"robotcode-robot==0.99.0",
|
|
32
|
+
"robotcode==0.99.0",
|
|
33
33
|
]
|
|
34
34
|
dynamic = ["version"]
|
|
35
35
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.99.0"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from enum import Flag
|
|
1
2
|
from pathlib import Path
|
|
2
3
|
from textwrap import indent
|
|
3
4
|
from typing import List, Optional, Set, Tuple
|
|
@@ -45,6 +46,14 @@ SEVERITY_COLORS = {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
|
|
49
|
+
class ReturnCode(Flag):
|
|
50
|
+
SUCCESS = 0
|
|
51
|
+
ERRORS = 1
|
|
52
|
+
WARNINGS = 2
|
|
53
|
+
INFOS = 4
|
|
54
|
+
HINTS = 8
|
|
55
|
+
|
|
56
|
+
|
|
48
57
|
class Statistic:
|
|
49
58
|
def __init__(self) -> None:
|
|
50
59
|
self.folders: Set[WorkspaceFolder] = set()
|
|
@@ -60,6 +69,18 @@ class Statistic:
|
|
|
60
69
|
f"Infos: {self.infos}, Hints: {self.hints}"
|
|
61
70
|
)
|
|
62
71
|
|
|
72
|
+
def calculate_return_code(self) -> ReturnCode:
|
|
73
|
+
return_code = ReturnCode.SUCCESS
|
|
74
|
+
if self.errors > 0:
|
|
75
|
+
return_code |= ReturnCode.ERRORS
|
|
76
|
+
if self.warnings > 0:
|
|
77
|
+
return_code |= ReturnCode.WARNINGS
|
|
78
|
+
if self.infos > 0:
|
|
79
|
+
return_code |= ReturnCode.INFOS
|
|
80
|
+
if self.hints > 0:
|
|
81
|
+
return_code |= ReturnCode.HINTS
|
|
82
|
+
return return_code
|
|
83
|
+
|
|
63
84
|
|
|
64
85
|
@analyze.command(
|
|
65
86
|
add_help_option=True,
|
|
@@ -151,7 +172,7 @@ class Statistic:
|
|
|
151
172
|
@pass_application
|
|
152
173
|
def code(
|
|
153
174
|
app: Application,
|
|
154
|
-
filter: Tuple[str],
|
|
175
|
+
filter: Tuple[str, ...],
|
|
155
176
|
variable: Tuple[str, ...],
|
|
156
177
|
variablefile: Tuple[str, ...],
|
|
157
178
|
pythonpath: Tuple[str, ...],
|
|
@@ -163,12 +184,23 @@ def code(
|
|
|
163
184
|
paths: Tuple[Path],
|
|
164
185
|
) -> None:
|
|
165
186
|
"""\
|
|
166
|
-
Performs static code analysis to
|
|
167
|
-
|
|
168
|
-
|
|
187
|
+
Performs static code analysis to identify potential issues in the specified *PATHS*. The analysis detects syntax
|
|
188
|
+
errors, missing keywords or variables, missing arguments, and other problems.
|
|
189
|
+
|
|
190
|
+
- **PATHS**: Can be individual files or directories. If no *PATHS* are provided, the current directory is
|
|
191
|
+
analyzed by default.
|
|
192
|
+
|
|
193
|
+
The return code is a bitwise combination of the following values:
|
|
194
|
+
|
|
195
|
+
\b
|
|
196
|
+
- `0`: **SUCCESS** - No issues detected.
|
|
197
|
+
- `1`: **ERRORS** - Critical issues found.
|
|
198
|
+
- `2`: **WARNINGS** - Non-critical issues detected.
|
|
199
|
+
- `4`: **INFORMATIONS** - General information messages.
|
|
200
|
+
- `8`: **HINTS** - Suggestions or improvements.
|
|
169
201
|
|
|
170
202
|
\b
|
|
171
|
-
Examples
|
|
203
|
+
*Examples*:
|
|
172
204
|
```
|
|
173
205
|
robotcode analyze code
|
|
174
206
|
robotcode analyze code --filter **/*.robot
|
|
@@ -273,7 +305,7 @@ def code(
|
|
|
273
305
|
|
|
274
306
|
app.echo(statistics_str)
|
|
275
307
|
|
|
276
|
-
app.exit(statistics.
|
|
308
|
+
app.exit(statistics.calculate_return_code().value)
|
|
277
309
|
|
|
278
310
|
except (TypeError, ValueError) as e:
|
|
279
311
|
raise click.ClickException(str(e)) from e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.98.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/code_analyzer.py
RENAMED
|
File without changes
|
|
File without changes
|
{robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/diagnostics_context.py
RENAMED
|
File without changes
|
|
File without changes
|
{robotcode_analyze-0.98.0 → robotcode_analyze-0.99.0}/src/robotcode/analyze/language_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|