robotframework-robocop 5.7.0__tar.gz → 5.8.1__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 (54) hide show
  1. {robotframework_robocop-5.7.0/robotframework_robocop.egg-info → robotframework_robocop-5.8.1}/PKG-INFO +20 -3
  2. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/__init__.py +1 -1
  3. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/misc.py +28 -4
  4. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/spacing.py +2 -2
  5. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/utils/disablers.py +1 -1
  6. robotframework_robocop-5.8.1/robocop/version.py +1 -0
  7. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1/robotframework_robocop.egg-info}/PKG-INFO +20 -3
  8. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robotframework_robocop.egg-info/requires.txt +1 -1
  9. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/setup.py +3 -1
  10. robotframework_robocop-5.7.0/robocop/version.py +0 -1
  11. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/LICENSE +0 -0
  12. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/MANIFEST.in +0 -0
  13. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/README.md +0 -0
  14. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/pyproject.toml +0 -0
  15. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/__main__.py +0 -0
  16. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/__init__.py +0 -0
  17. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/comments.py +0 -0
  18. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/community_rules/__init__.py +0 -0
  19. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/community_rules/keywords.py +0 -0
  20. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/community_rules/misc.py +0 -0
  21. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/community_rules/usage.py +0 -0
  22. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/documentation.py +0 -0
  23. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/duplications.py +0 -0
  24. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/errors.py +0 -0
  25. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/lengths.py +0 -0
  26. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/naming.py +0 -0
  27. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/checkers/tags.py +0 -0
  28. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/config.py +0 -0
  29. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/exceptions.py +0 -0
  30. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/files.py +0 -0
  31. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/__init__.py +0 -0
  32. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/compare_runs_report.py +0 -0
  33. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/file_stats_report.py +0 -0
  34. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/json_report.py +0 -0
  35. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/return_status_report.py +0 -0
  36. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/robocop_version_report.py +0 -0
  37. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/rules_by_id_report.py +0 -0
  38. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/rules_by_severity_report.py +0 -0
  39. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/sarif_report.py +0 -0
  40. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/time_taken_report.py +0 -0
  41. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/reports/timestamp_report.py +0 -0
  42. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/rules.py +0 -0
  43. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/run.py +0 -0
  44. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/utils/__init__.py +2 -2
  45. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/utils/file_types.py +0 -0
  46. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/utils/misc.py +0 -0
  47. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/utils/run_keywords.py +0 -0
  48. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/utils/variable_matcher.py +0 -0
  49. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robocop/utils/version_matching.py +0 -0
  50. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robotframework_robocop.egg-info/SOURCES.txt +0 -0
  51. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robotframework_robocop.egg-info/dependency_links.txt +0 -0
  52. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robotframework_robocop.egg-info/entry_points.txt +0 -0
  53. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/robotframework_robocop.egg-info/top_level.txt +0 -0
  54. {robotframework_robocop-5.7.0 → robotframework_robocop-5.8.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: robotframework-robocop
3
- Version: 5.7.0
3
+ Version: 5.8.1
4
4
  Summary: Static code analysis tool (linter) for Robot Framework
5
5
  Home-page: https://github.com/MarketSquare/robotframework-robocop
6
6
  Download-URL: https://pypi.org/project/robotframework-robocop
@@ -19,6 +19,8 @@ Classifier: Programming Language :: Python
19
19
  Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
22
24
  Classifier: Framework :: Robot Framework
23
25
  Classifier: Framework :: Robot Framework :: Tool
24
26
  Classifier: Topic :: Software Development :: Testing
@@ -29,7 +31,7 @@ Requires-Python: >=3.9
29
31
  Description-Content-Type: text/markdown
30
32
  License-File: LICENSE
31
33
  Requires-Dist: jinja2<4.0,>=3.0
32
- Requires-Dist: robotframework<7.2,>=3.2.2
34
+ Requires-Dist: robotframework<7.3,>=3.2.2
33
35
  Requires-Dist: pathspec<0.13,>=0.9
34
36
  Requires-Dist: tomli>=2.0.0
35
37
  Requires-Dist: pytz>=2022.7
@@ -49,6 +51,21 @@ Requires-Dist: sphinx_design; extra == "doc"
49
51
  Requires-Dist: sphinx-copybutton; extra == "doc"
50
52
  Requires-Dist: sphinxemoji; extra == "doc"
51
53
  Requires-Dist: pygments; extra == "doc"
54
+ Dynamic: author
55
+ Dynamic: author-email
56
+ Dynamic: classifier
57
+ Dynamic: description
58
+ Dynamic: description-content-type
59
+ Dynamic: download-url
60
+ Dynamic: home-page
61
+ Dynamic: keywords
62
+ Dynamic: license
63
+ Dynamic: platform
64
+ Dynamic: project-url
65
+ Dynamic: provides-extra
66
+ Dynamic: requires-dist
67
+ Dynamic: requires-python
68
+ Dynamic: summary
52
69
 
53
70
  [![Unit tests](https://github.com/MarketSquare/robotframework-robocop/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/MarketSquare/robotframework-robocop/actions/workflows/unit-tests.yml "GitHub Workflow Unit Tests Status")
54
71
  ![Codecov](https://img.shields.io/codecov/c/github/MarketSquare/robotframework-robocop/master "Code coverage on master branch")
@@ -3,4 +3,4 @@ from robocop.config import Config
3
3
  from robocop.run import Robocop, run_robocop
4
4
  from robocop.version import __version__
5
5
 
6
- __all__ = ["__version__", "run_robocop", "checkers", "Robocop", "Config"]
6
+ __all__ = ["Config", "Robocop", "__version__", "checkers", "run_robocop"]
@@ -1,6 +1,7 @@
1
1
  """Miscellaneous checkers"""
2
2
 
3
3
  import ast
4
+ import re
4
5
  from dataclasses import dataclass
5
6
  from pathlib import Path
6
7
  from typing import Optional
@@ -882,12 +883,20 @@ rules = {
882
883
  misreading your keyword arguments, explicitly state that the value is empty using the
883
884
  built-in ``${EMPTY}`` variable.
884
885
 
885
- If your argument is falsly flagged by this rule, escape the ``=`` character in your argument
886
- value by like so: ``\\=``.
887
-
888
886
  Example of a rule violation::
889
887
 
890
888
  My Amazing Keyword argument_name=
889
+
890
+ Positional arguments that end with a ``=`` character can be falsly flagged by this rule. You
891
+ can fix this by making the situation more explicit:
892
+
893
+ 1. Escape the ``=`` character::
894
+
895
+ Log value\\=
896
+
897
+ 2. Make it a named argument instead::
898
+
899
+ Log message=value=
891
900
  """,
892
901
  ),
893
902
  }
@@ -1383,7 +1392,7 @@ class LoopStatementsChecker(VisitorChecker):
1383
1392
  )
1384
1393
 
1385
1394
  def check_statement_in_loop(self, node, token_type):
1386
- if self.loops or node.errors and f"{token_type} can only be used inside a loop." not in node.errors:
1395
+ if self.loops or (node.errors and f"{token_type} can only be used inside a loop." not in node.errors):
1387
1396
  return
1388
1397
  self.report(
1389
1398
  "statement-outside-loop",
@@ -1642,6 +1651,11 @@ class UnusedVariablesChecker(VisitorChecker):
1642
1651
  if node.next:
1643
1652
  self.visit_Try(node.next)
1644
1653
 
1654
+ def visit_Group(self, node): # noqa: N802
1655
+ for token in node.header.get_tokens(Token.ARGUMENT):
1656
+ self.find_not_nested_variable(token.value, is_var=False)
1657
+ self.generic_visit(node)
1658
+
1645
1659
  def visit_KeywordCall(self, node): # noqa: N802
1646
1660
  for token in node.get_tokens(Token.ARGUMENT, Token.KEYWORD): # argument can be used in keyword name
1647
1661
  self.find_not_nested_variable(token.value, is_var=False)
@@ -1992,6 +2006,7 @@ class UndefinedArgumentDefaultChecker(VisitorChecker):
1992
2006
  "undefined-argument-default",
1993
2007
  "undefined-argument-value",
1994
2008
  )
2009
+ valid_argument_name = re.compile(r"[a-zA-Z0-9-_ ]+")
1995
2010
 
1996
2011
  def visit_Arguments(self, node: Arguments): # noqa: N802
1997
2012
  for token in node.get_tokens(Token.ARGUMENT):
@@ -2029,10 +2044,19 @@ class UndefinedArgumentDefaultChecker(VisitorChecker):
2029
2044
  # `=` is escaped
2030
2045
  continue
2031
2046
 
2047
+ if arg_name.endswith(" "):
2048
+ # Space before `=` is not a named arg
2049
+ continue
2050
+
2032
2051
  if default_val != "":
2033
2052
  # Has a value
2034
2053
  continue
2035
2054
 
2055
+ is_plain_var_name = self.valid_argument_name.fullmatch(arg_name)
2056
+ if is_plain_var_name is None:
2057
+ # Argument name includes invalid chars
2058
+ continue
2059
+
2036
2060
  # Falsly triggers if a positional argument ends with `=`
2037
2061
  # The language server has the same behavior
2038
2062
  self.report(
@@ -469,7 +469,7 @@ class EmptyLinesChecker(VisitorChecker):
469
469
  self.verify_consecutive_empty_lines(node.body, check_trailing=True)
470
470
  self.generic_visit(node)
471
471
 
472
- visit_ForLoop = visit_While = visit_Try = visit_If = visit_For # noqa: N815
472
+ visit_ForLoop = visit_While = visit_Try = visit_If = visit_Group = visit_For # noqa: N815
473
473
 
474
474
  def visit_File(self, node): # noqa: N802
475
475
  for section in node.sections:
@@ -707,7 +707,7 @@ class UnevenIndentChecker(VisitorChecker):
707
707
  self.visit(child)
708
708
  self.visit_Statement(node.end)
709
709
 
710
- visit_While = visit_ForLoop = visit_For # noqa: N815
710
+ visit_While = visit_ForLoop = visit_Group = visit_For # noqa: N815
711
711
 
712
712
  def get_common_if_indent(self, node):
713
713
  indents = count_indents(node)
@@ -73,7 +73,7 @@ class DisablersVisitor(ModelVisitor):
73
73
  self.parse_disablers_in_node(node)
74
74
  self.is_first_comment_section = False
75
75
 
76
- visit_TestCase = visit_Keyword = visit_Try = visit_For = visit_ForLoop = visit_While = visit_Section # noqa: N815
76
+ visit_TestCase = visit_Keyword = visit_Try = visit_For = visit_ForLoop = visit_While = visit_Group = visit_Section # noqa: N815
77
77
 
78
78
  def visit_If(self, node): # noqa: N802
79
79
  last_line = node.body[-1].end_lineno if node.body else None
@@ -0,0 +1 @@
1
+ __version__ = "5.8.1"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: robotframework-robocop
3
- Version: 5.7.0
3
+ Version: 5.8.1
4
4
  Summary: Static code analysis tool (linter) for Robot Framework
5
5
  Home-page: https://github.com/MarketSquare/robotframework-robocop
6
6
  Download-URL: https://pypi.org/project/robotframework-robocop
@@ -19,6 +19,8 @@ Classifier: Programming Language :: Python
19
19
  Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
22
24
  Classifier: Framework :: Robot Framework
23
25
  Classifier: Framework :: Robot Framework :: Tool
24
26
  Classifier: Topic :: Software Development :: Testing
@@ -29,7 +31,7 @@ Requires-Python: >=3.9
29
31
  Description-Content-Type: text/markdown
30
32
  License-File: LICENSE
31
33
  Requires-Dist: jinja2<4.0,>=3.0
32
- Requires-Dist: robotframework<7.2,>=3.2.2
34
+ Requires-Dist: robotframework<7.3,>=3.2.2
33
35
  Requires-Dist: pathspec<0.13,>=0.9
34
36
  Requires-Dist: tomli>=2.0.0
35
37
  Requires-Dist: pytz>=2022.7
@@ -49,6 +51,21 @@ Requires-Dist: sphinx_design; extra == "doc"
49
51
  Requires-Dist: sphinx-copybutton; extra == "doc"
50
52
  Requires-Dist: sphinxemoji; extra == "doc"
51
53
  Requires-Dist: pygments; extra == "doc"
54
+ Dynamic: author
55
+ Dynamic: author-email
56
+ Dynamic: classifier
57
+ Dynamic: description
58
+ Dynamic: description-content-type
59
+ Dynamic: download-url
60
+ Dynamic: home-page
61
+ Dynamic: keywords
62
+ Dynamic: license
63
+ Dynamic: platform
64
+ Dynamic: project-url
65
+ Dynamic: provides-extra
66
+ Dynamic: requires-dist
67
+ Dynamic: requires-python
68
+ Dynamic: summary
52
69
 
53
70
  [![Unit tests](https://github.com/MarketSquare/robotframework-robocop/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/MarketSquare/robotframework-robocop/actions/workflows/unit-tests.yml "GitHub Workflow Unit Tests Status")
54
71
  ![Codecov](https://img.shields.io/codecov/c/github/MarketSquare/robotframework-robocop/master "Code coverage on master branch")
@@ -1,5 +1,5 @@
1
1
  jinja2<4.0,>=3.0
2
- robotframework<7.2,>=3.2.2
2
+ robotframework<7.3,>=3.2.2
3
3
  pathspec<0.13,>=0.9
4
4
  tomli>=2.0.0
5
5
  pytz>=2022.7
@@ -14,6 +14,8 @@ Programming Language :: Python
14
14
  Programming Language :: Python :: 3.9
15
15
  Programming Language :: Python :: 3.10
16
16
  Programming Language :: Python :: 3.11
17
+ Programming Language :: Python :: 3.12
18
+ Programming Language :: Python :: 3.13
17
19
  Framework :: Robot Framework
18
20
  Framework :: Robot Framework :: Tool
19
21
  Topic :: Software Development :: Testing
@@ -50,7 +52,7 @@ setup(
50
52
  include_package_data=True,
51
53
  install_requires=[
52
54
  "jinja2>=3.0,<4.0",
53
- "robotframework>=3.2.2,<7.2",
55
+ "robotframework>=3.2.2,<7.3",
54
56
  "pathspec>=0.9,<0.13",
55
57
  "tomli>=2.0.0",
56
58
  "pytz>=2022.7",
@@ -1 +0,0 @@
1
- __version__ = "5.7.0"
@@ -22,11 +22,11 @@ from robocop.utils.misc import (
22
22
  )
23
23
 
24
24
  __all__ = [ # TODO: replace with direct imports
25
+ "ROBOT_VERSION",
26
+ "AssignmentTypeDetector",
25
27
  "DisablersFinder",
26
28
  "FileType",
27
29
  "FileTypeChecker",
28
- "ROBOT_VERSION",
29
- "AssignmentTypeDetector",
30
30
  "RecommendationFinder",
31
31
  "find_robot_vars",
32
32
  "get_errors",