robotcode-robot 1.6.0__tar.gz → 1.7.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.
Files changed (34) hide show
  1. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/PKG-INFO +2 -2
  2. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/pyproject.toml +1 -1
  3. robotcode_robot-1.7.0/src/robotcode/robot/__version__.py +1 -0
  4. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/entities.py +2 -1
  5. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/errors.py +1 -0
  6. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/namespace_analyzer.py +21 -0
  7. robotcode_robot-1.6.0/src/robotcode/robot/__version__.py +0 -1
  8. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/.gitignore +0 -0
  9. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/LICENSE.txt +0 -0
  10. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/README.md +0 -0
  11. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/__init__.py +0 -0
  12. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/config/__init__.py +0 -0
  13. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/config/loader.py +0 -0
  14. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/config/model.py +0 -0
  15. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/config/utils.py +0 -0
  16. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/__init__.py +0 -0
  17. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/data_cache.py +0 -0
  18. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/diagnostics_modifier.py +0 -0
  19. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/document_cache_helper.py +0 -0
  20. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/imports_manager.py +0 -0
  21. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/keyword_finder.py +0 -0
  22. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/library_doc.py +0 -0
  23. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/model_helper.py +0 -0
  24. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/namespace.py +1 -1
  25. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/diagnostics/workspace_config.py +0 -0
  26. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/py.typed +0 -0
  27. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/__init__.py +0 -0
  28. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/ast.py +0 -0
  29. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/markdownformatter.py +0 -0
  30. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/match.py +0 -0
  31. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/robot_path.py +0 -0
  32. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/stubs.py +0 -0
  33. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/variables.py +0 -0
  34. {robotcode_robot-1.6.0 → robotcode_robot-1.7.0}/src/robotcode/robot/utils/visitor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotcode-robot
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: Support classes for RobotCode for handling Robot Framework projects.
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://opencollective.com/robotcode
@@ -26,7 +26,7 @@ Classifier: Topic :: Utilities
26
26
  Classifier: Typing :: Typed
27
27
  Requires-Python: >=3.8
28
28
  Requires-Dist: platformdirs<4.4.0,>=3.2.0
29
- Requires-Dist: robotcode-core==1.6.0
29
+ Requires-Dist: robotcode-core==1.7.0
30
30
  Requires-Dist: robotframework>=4.1.0
31
31
  Requires-Dist: tomli>=1.1.0; python_version < '3.11'
32
32
  Description-Content-Type: text/markdown
@@ -30,7 +30,7 @@ dependencies = [
30
30
  "robotframework>=4.1.0",
31
31
  "tomli>=1.1.0; python_version < '3.11'",
32
32
  "platformdirs>=3.2.0,<4.4.0",
33
- "robotcode-core==1.6.0",
33
+ "robotcode-core==1.7.0",
34
34
  ]
35
35
  dynamic = ["version"]
36
36
 
@@ -0,0 +1 @@
1
+ __version__ = "1.7.0"
@@ -179,7 +179,8 @@ class VariableDefinitionType(Enum):
179
179
  @dataclass
180
180
  class VariableDefinition(SourceEntity):
181
181
  name: str
182
- name_token: Optional[Token]
182
+ name_token: Optional[Token] # TODO: this is not needed anymore, but kept for compatibility
183
+
183
184
  type: VariableDefinitionType = VariableDefinitionType.VARIABLE
184
185
 
185
186
  has_value: bool = field(default=False, compare=False)
@@ -39,6 +39,7 @@ class Error:
39
39
  INVALID_HEADER = "InvalidHeader"
40
40
  DEPRECATED_HEADER = "DeprecatedHeader"
41
41
  OVERRIDDEN_BY_COMMANDLINE = "OverriddenByCommandLine"
42
+ OVERRIDES_IMPORTED_VARIABLE = "OverridesImportedVariable"
42
43
  VARIABLE_ALREADY_DEFINED = "VariableAlreadyDefined"
43
44
  VARIABLE_OVERRIDDEN = "VariableOverridden"
44
45
  MODEL_ERROR = "ModelError"
@@ -234,6 +234,27 @@ class NamespaceAnalyzer(Visitor):
234
234
  )
235
235
 
236
236
  add_to_references = True
237
+
238
+ if existing_var is not None and existing_var.type == VariableDefinitionType.IMPORTED_VARIABLE:
239
+ self._append_diagnostics(
240
+ r,
241
+ "Overrides imported variable.",
242
+ DiagnosticSeverity.WARNING,
243
+ Error.OVERRIDES_IMPORTED_VARIABLE,
244
+ related_information=[
245
+ DiagnosticRelatedInformation(
246
+ location=Location(
247
+ uri=str(Uri.from_path(existing_var.source)),
248
+ range=existing_var.range,
249
+ ),
250
+ message="Already defined here.",
251
+ )
252
+ ]
253
+ if existing_var.source
254
+ else None,
255
+ )
256
+ existing_var = None
257
+
237
258
  first_overidden_reference: Optional[VariableDefinition] = None
238
259
  if existing_var is not None:
239
260
  self._variable_references[existing_var].add(Location(self._namespace.document_uri, r))
@@ -1 +0,0 @@
1
- __version__ = "1.6.0"
@@ -1116,8 +1116,8 @@ class Namespace:
1116
1116
  else []
1117
1117
  ),
1118
1118
  [] if skip_global_variables or skip_commandline_variables else self.get_command_line_variables(),
1119
- [] if skip_global_variables else self.get_own_variables(),
1120
1119
  [] if skip_global_variables else self.get_imported_variables(),
1120
+ [] if skip_global_variables else self.get_own_variables(),
1121
1121
  [] if skip_global_variables else self.get_builtin_variables(),
1122
1122
  )
1123
1123
  )