robotcode 0.91.0__tar.gz → 0.93.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-0.91.0 → robotcode-0.93.0}/.gitignore +2 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/CHANGELOG.md +71 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/PKG-INFO +15 -12
- {robotcode-0.91.0 → robotcode-0.93.0}/hatch.toml +4 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/pyproject.toml +19 -12
- {robotcode-0.91.0 → robotcode-0.93.0}/src/robotcode/cli/__init__.py +42 -5
- robotcode-0.93.0/src/robotcode/cli/__version__.py +1 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/src/robotcode/cli/commands/config.py +75 -51
- {robotcode-0.91.0 → robotcode-0.93.0}/src/robotcode/cli/commands/profiles.py +12 -4
- robotcode-0.91.0/src/robotcode/cli/__version__.py +0 -1
- {robotcode-0.91.0 → robotcode-0.93.0}/LICENSE.txt +0 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/README.md +0 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/src/robotcode/cli/__main__.py +0 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/src/robotcode/cli/commands/__init__.py +0 -0
- {robotcode-0.91.0 → robotcode-0.93.0}/src/robotcode/cli/py.typed +0 -0
@@ -2,6 +2,77 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
|
4
4
|
|
5
|
+
## [0.93.0](https://github.com/robotcodedev/robotcode/compare/v0.92.0..v0.93.0) - 2024-10-08
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
- Logging of measure_time if log is disabled ([725c739](https://github.com/robotcodedev/robotcode/commit/725c739c0ed01b1249a611605c96e035467f03fa))
|
10
|
+
- Enable supportsANSIStyling in DAP to reeanble colored output in debug console ([0d5616c](https://github.com/robotcodedev/robotcode/commit/0d5616c33215ed993052d4f50e7ad41a13b21058))
|
11
|
+
- Corrected highlightning invalid sections for RF7 ([d139ff1](https://github.com/robotcodedev/robotcode/commit/d139ff1f9c309060cc12d1d7499cab1ada4a0b01))
|
12
|
+
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
- **cli:** New command line interface tool - Robot Framework REPL interpreter ([be386d2](https://github.com/robotcodedev/robotcode/commit/be386d244be0b9b85ca4fbe49597985652f066db))
|
17
|
+
|
18
|
+
The new CLI command `repl` introduces an interactive Robot Framework interpreter. You can install it by running `pip install robotcode[repl]` and start it via the command line using `robotcode repl`.
|
19
|
+
|
20
|
+
With this interactive interpreter, you can execute Robot Framework keywords without the need to run a full test suite. By default, all BuiltIn keywords are immediately accessible. To load a library, you can use the `import library` keyword, and for resources or variable files, you can use the corresponding built-in commands `import resource` and `import variables`. The outcome of any keyword execution, along with relevant log details, is displayed directly in the console.
|
21
|
+
|
22
|
+
You can exit the interpreter using the `exit` keyword or by pressing `CTRL`+`D` on Unix-like systems and `CTRL+Z` followed by `ENTER` on Windows.
|
23
|
+
|
24
|
+
At this stage, the implementation is fairly basic, but additional features for the REPL command are planned. This also serves as the first step toward an exciting new feature (spoiler alert!): Robot Framework Notebooks.
|
25
|
+
|
26
|
+
- **debugger:** Increase timeouts for debugger to fit better to python debugger timeouts and introduce environment variables to override these timeouts ([63f3e4a](https://github.com/robotcodedev/robotcode/commit/63f3e4ac4d061eed95c95d615c501b2d4430e378))
|
27
|
+
- **langserver:** Resolve variable in hover for documentation settings in testcases and keywords ([ffa9bdb](https://github.com/robotcodedev/robotcode/commit/ffa9bdb2cdca47b20f56b14deaece59fc49b9a13))
|
28
|
+
- **vscode:** Introduce RobotCode: Start Terminal REPL command for launching the interactive Robot Framework interpreter directly from VSCode ([f4025fb](https://github.com/robotcodedev/robotcode/commit/f4025fb77c54ea49531c1ec67f1072c0a43c87f9))
|
29
|
+
- Improved logging with time information ([27d21b5](https://github.com/robotcodedev/robotcode/commit/27d21b599d7d5005e2920a11b47583e32f9a049c))
|
30
|
+
|
31
|
+
|
32
|
+
- Operations that take a little longer now have an indication of how long they took
|
33
|
+
- 2 new command line switches `--log-format` and `--log-style`, see also the Python logging documentation
|
34
|
+
- `--root` command line argument to specify a project root and disable autodetection of project root ([add4102](https://github.com/robotcodedev/robotcode/commit/add4102594ee73c3a93760eb4a5846358ddf2b1a))
|
35
|
+
- Add `--no-vcs` command-line option to ignore VCS directories (e.g., .git) when detecting the project root ([d7e28f2](https://github.com/robotcodedev/robotcode/commit/d7e28f2c7c7ffd42ce3d989d1ae8f4e8207d7b81))
|
36
|
+
|
37
|
+
|
38
|
+
#closes 201
|
39
|
+
|
40
|
+
|
41
|
+
### Performance
|
42
|
+
|
43
|
+
- **langserver:** Speedup semantic highlightning a lot ([567ac72](https://github.com/robotcodedev/robotcode/commit/567ac72b393d6e42baadd575195744c5503da297))
|
44
|
+
|
45
|
+
|
46
|
+
### Refactor
|
47
|
+
|
48
|
+
- Some performance tweaks ([d3b39be](https://github.com/robotcodedev/robotcode/commit/d3b39be576dd80d757554708fff2cd0bc40354ff))
|
49
|
+
|
50
|
+
|
51
|
+
## [0.92.0](https://github.com/robotcodedev/robotcode/compare/v0.91.0..v0.92.0) - 2024-10-01
|
52
|
+
|
53
|
+
### Features
|
54
|
+
|
55
|
+
- **analyze:** Allow shortforms of `warning` and `information`, `warn` and `info` in diagnostic modifiers ([f226091](https://github.com/robotcodedev/robotcode/commit/f226091e59b0fff2858de7311d542b903c5bf2d3))
|
56
|
+
- **config:** Added posibility to allow different tool configs to robot.toml.json schema ([ee256ce](https://github.com/robotcodedev/robotcode/commit/ee256ce38b39ae67ae107bb5fffa5dba8d8d7db4))
|
57
|
+
- **robot.toml:** Introduce new settings for analysis in robot.toml ([fa37dba](https://github.com/robotcodedev/robotcode/commit/fa37dba7ccfebf9d221b6985a12e460e27209f64))
|
58
|
+
- **vscode:** Introduce setting for modifing the diagnostics severity ([5cca59f](https://github.com/robotcodedev/robotcode/commit/5cca59fd364cb1c6a8a8c6f0e63a956bca88e366))
|
59
|
+
|
60
|
+
With these settings, you can override the default configuration for all diagnostic messages. By combining file, block, and line diagnostic modifiers, you can precisely control how specific errors are displayed.
|
61
|
+
|
62
|
+
- **`robotcode.analysis.diagnosticModifiers.ignore`**: Suppresses specific diagnostics from being displayed. You can specify one or more error codes, like `MultipleKeywords` or `[multiple-keywords, VariableNotFound]`. Use `*` to ignore all errors and then maybe add specific error codes to other modifiers, such as `information`, to selectively show them.
|
63
|
+
- **`robotcode.analysis.diagnosticModifiers.error`**: Treats selected diagnostics as errors.
|
64
|
+
- **`robotcode.analysis.diagnosticModifiers.warning`**: Displays chosen diagnostics as warnings.
|
65
|
+
- **`robotcode.analysis.diagnosticModifiers.information`**: Shows specified diagnostics as information
|
66
|
+
- **`robotcode.analysis.diagnosticModifiers.hint`**: Marks selected diagnostics as hints
|
67
|
+
|
68
|
+
These settings allow you to tailor the diagnostic outputs to meet the specific needs of your project.
|
69
|
+
|
70
|
+
- Introduce `Select Python Environment` command and deprecate `robotcode.python` ([be0573d](https://github.com/robotcodedev/robotcode/commit/be0573ddcfaf1100de8058bc6383a013eaf4ee88))
|
71
|
+
|
72
|
+
|
73
|
+
See [here](https://github.com/microsoft/vscode-python/wiki/Setting-descriptions#pythondefaultinterpreterpath) for an explanation.
|
74
|
+
|
75
|
+
|
5
76
|
## [0.91.0](https://github.com/robotcodedev/robotcode/compare/v0.90.0..v0.91.0) - 2024-09-27
|
6
77
|
|
7
78
|
### Bug Fixes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: robotcode
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.93.0
|
4
4
|
Summary: Command line interface for RobotCode
|
5
5
|
Project-URL: Homepage, https://robotcode.io
|
6
6
|
Project-URL: Donate, https://opencollective.com/robotcode
|
@@ -33,33 +33,36 @@ Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
|
|
33
33
|
Classifier: Topic :: Utilities
|
34
34
|
Classifier: Typing :: Typed
|
35
35
|
Requires-Python: >=3.8
|
36
|
-
Requires-Dist: robotcode-core==0.
|
37
|
-
Requires-Dist: robotcode-plugin==0.
|
38
|
-
Requires-Dist: robotcode-robot==0.
|
36
|
+
Requires-Dist: robotcode-core==0.93.0
|
37
|
+
Requires-Dist: robotcode-plugin==0.93.0
|
38
|
+
Requires-Dist: robotcode-robot==0.93.0
|
39
39
|
Provides-Extra: all
|
40
40
|
Requires-Dist: docutils; extra == 'all'
|
41
41
|
Requires-Dist: pyyaml>=5.4; extra == 'all'
|
42
42
|
Requires-Dist: rich; extra == 'all'
|
43
|
-
Requires-Dist: robotcode-analyze==0.
|
44
|
-
Requires-Dist: robotcode-debugger==0.
|
45
|
-
Requires-Dist: robotcode-language-server==0.
|
46
|
-
Requires-Dist: robotcode-
|
43
|
+
Requires-Dist: robotcode-analyze==0.93.0; extra == 'all'
|
44
|
+
Requires-Dist: robotcode-debugger==0.93.0; extra == 'all'
|
45
|
+
Requires-Dist: robotcode-language-server==0.93.0; extra == 'all'
|
46
|
+
Requires-Dist: robotcode-repl==0.93.0; extra == 'all'
|
47
|
+
Requires-Dist: robotcode-runner==0.93.0; extra == 'all'
|
47
48
|
Requires-Dist: robotframework-robocop>=2.0.0; extra == 'all'
|
48
49
|
Requires-Dist: robotframework-tidy>=2.0.0; extra == 'all'
|
49
50
|
Provides-Extra: analyze
|
50
|
-
Requires-Dist: robotcode-analyze==0.
|
51
|
+
Requires-Dist: robotcode-analyze==0.93.0; extra == 'analyze'
|
51
52
|
Provides-Extra: colored
|
52
53
|
Requires-Dist: rich; extra == 'colored'
|
53
54
|
Provides-Extra: debugger
|
54
|
-
Requires-Dist: robotcode-debugger==0.
|
55
|
+
Requires-Dist: robotcode-debugger==0.93.0; extra == 'debugger'
|
55
56
|
Provides-Extra: languageserver
|
56
|
-
Requires-Dist: robotcode-language-server==0.
|
57
|
+
Requires-Dist: robotcode-language-server==0.93.0; extra == 'languageserver'
|
57
58
|
Provides-Extra: lint
|
58
59
|
Requires-Dist: robotframework-robocop>=2.0.0; extra == 'lint'
|
60
|
+
Provides-Extra: repl
|
61
|
+
Requires-Dist: robotcode-repl==0.93.0; extra == 'repl'
|
59
62
|
Provides-Extra: rest
|
60
63
|
Requires-Dist: docutils; extra == 'rest'
|
61
64
|
Provides-Extra: runner
|
62
|
-
Requires-Dist: robotcode-runner==0.
|
65
|
+
Requires-Dist: robotcode-runner==0.93.0; extra == 'runner'
|
63
66
|
Provides-Extra: tidy
|
64
67
|
Requires-Dist: robotframework-tidy>=2.0.0; extra == 'tidy'
|
65
68
|
Provides-Extra: yaml
|
@@ -43,6 +43,10 @@ create-json-schema = "python ./scripts/create_robot_toml_json_schema.py"
|
|
43
43
|
generate-rf-options = "python ./scripts/generate_rf_options.py"
|
44
44
|
install-packages = "python ./scripts/install_packages.py"
|
45
45
|
|
46
|
+
[envs.rflatest313]
|
47
|
+
python = "3.13"
|
48
|
+
extra-dependencies = ["robotframework==7.1"]
|
49
|
+
|
46
50
|
[envs.rfmaster313]
|
47
51
|
python = "3.13"
|
48
52
|
extra-dependencies = [
|
@@ -50,9 +50,9 @@ classifiers = [
|
|
50
50
|
]
|
51
51
|
requires-python = ">=3.8"
|
52
52
|
dependencies = [
|
53
|
-
"robotcode-core==0.
|
54
|
-
"robotcode-plugin==0.
|
55
|
-
"robotcode-robot==0.
|
53
|
+
"robotcode-core==0.93.0",
|
54
|
+
"robotcode-plugin==0.93.0",
|
55
|
+
"robotcode-robot==0.93.0",
|
56
56
|
]
|
57
57
|
dynamic = ["version"]
|
58
58
|
|
@@ -70,20 +70,22 @@ robotcode = "robotcode.cli.__main__:main"
|
|
70
70
|
|
71
71
|
|
72
72
|
[project.optional-dependencies]
|
73
|
-
debugger = ["robotcode-debugger==0.
|
74
|
-
languageserver = ["robotcode-language-server==0.
|
75
|
-
runner = ["robotcode-runner==0.
|
76
|
-
analyze = ["robotcode-analyze==0.
|
73
|
+
debugger = ["robotcode-debugger==0.93.0"]
|
74
|
+
languageserver = ["robotcode-language-server==0.93.0"]
|
75
|
+
runner = ["robotcode-runner==0.93.0"]
|
76
|
+
analyze = ["robotcode-analyze==0.93.0"]
|
77
77
|
yaml = ["PyYAML>=5.4"]
|
78
78
|
lint = ["robotframework-robocop>=2.0.0"]
|
79
79
|
tidy = ["robotframework-tidy>=2.0.0"]
|
80
80
|
rest = ["docutils"]
|
81
|
+
repl = ["robotcode-repl==0.93.0"]
|
81
82
|
colored = ["rich"]
|
82
83
|
all = [
|
83
|
-
"robotcode-debugger==0.
|
84
|
-
"robotcode-language-server==0.
|
85
|
-
"robotcode-runner==0.
|
86
|
-
"robotcode-analyze==0.
|
84
|
+
"robotcode-debugger==0.93.0",
|
85
|
+
"robotcode-language-server==0.93.0",
|
86
|
+
"robotcode-runner==0.93.0",
|
87
|
+
"robotcode-analyze==0.93.0",
|
88
|
+
"robotcode-repl==0.93.0",
|
87
89
|
"PyYAML>=5.4",
|
88
90
|
"robotframework-robocop>=2.0.0",
|
89
91
|
"robotframework-tidy>=2.0.0",
|
@@ -142,7 +144,7 @@ filterwarnings = "ignore:.*Using or importing the ABCs from 'collections' instea
|
|
142
144
|
testpaths = ["tests"]
|
143
145
|
junit_suite_name = "robotcode"
|
144
146
|
# console_output_style = "classic"
|
145
|
-
|
147
|
+
log_cli = true
|
146
148
|
# log_cli_level = 4
|
147
149
|
# log_cli_format = "%(levelname)s %(name)s: %(message)s"
|
148
150
|
asyncio_mode = "auto"
|
@@ -318,3 +320,8 @@ pre_bump_hooks = [
|
|
318
320
|
"hatch run build:update-changelog",
|
319
321
|
"git add .",
|
320
322
|
]
|
323
|
+
|
324
|
+
|
325
|
+
[tool.robotcode-analyze.extend-modifiers]
|
326
|
+
information = ["info_from_pyproject_toml"]
|
327
|
+
extend-hint = ["a_hint_from_pyproject_toml"]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import logging
|
2
2
|
from pathlib import Path
|
3
|
-
from typing import List, Optional
|
3
|
+
from typing import List, Literal, Optional
|
4
4
|
|
5
5
|
import click
|
6
6
|
|
@@ -49,6 +49,21 @@ from .commands import config, profiles
|
|
49
49
|
If not specified, the default profile is used.
|
50
50
|
""",
|
51
51
|
)
|
52
|
+
@click.option(
|
53
|
+
"-r",
|
54
|
+
"--root",
|
55
|
+
"root",
|
56
|
+
type=click.Path(exists=True, path_type=Path, dir_okay=True, file_okay=False, resolve_path=True),
|
57
|
+
multiple=False,
|
58
|
+
show_envvar=True,
|
59
|
+
help="Specifies the root path to be used for the project. It will be automatically detected if not provided.",
|
60
|
+
)
|
61
|
+
@click.option(
|
62
|
+
"--no-vcs",
|
63
|
+
is_flag=True,
|
64
|
+
show_envvar=True,
|
65
|
+
help="Ignore version control system directories (e.g., .git, .hg) when detecting the project root.",
|
66
|
+
)
|
52
67
|
@click.option(
|
53
68
|
"-f",
|
54
69
|
"--format",
|
@@ -95,6 +110,22 @@ from .commands import config, profiles
|
|
95
110
|
show_default=True,
|
96
111
|
show_envvar=True,
|
97
112
|
)
|
113
|
+
@click.option(
|
114
|
+
"--log-format",
|
115
|
+
type=str,
|
116
|
+
help="Sets the log format. See python logging documentation for more information.",
|
117
|
+
default="%(name)s:%(levelname)s: %(message)s",
|
118
|
+
show_default=True,
|
119
|
+
show_envvar=True,
|
120
|
+
)
|
121
|
+
@click.option(
|
122
|
+
"--log-style",
|
123
|
+
type=click.Choice(["%", "{", "$"]),
|
124
|
+
help="Sets the log style. See python logging documentation for more information.",
|
125
|
+
default="%",
|
126
|
+
show_default=True,
|
127
|
+
show_envvar=True,
|
128
|
+
)
|
98
129
|
@click.option(
|
99
130
|
"--log-filename",
|
100
131
|
type=click.Path(
|
@@ -160,6 +191,8 @@ def robotcode(
|
|
160
191
|
app: Application,
|
161
192
|
config_files: Optional[List[Path]],
|
162
193
|
profiles: Optional[List[str]],
|
194
|
+
root: Optional[Path],
|
195
|
+
no_vcs: bool,
|
163
196
|
format: Optional[OutputFormat],
|
164
197
|
dry: bool,
|
165
198
|
verbose: bool,
|
@@ -167,6 +200,8 @@ def robotcode(
|
|
167
200
|
pager: Optional[bool],
|
168
201
|
log: bool,
|
169
202
|
log_level: str,
|
203
|
+
log_format: str,
|
204
|
+
log_style: Literal["%", "{", "$"],
|
170
205
|
log_filename: Optional[str],
|
171
206
|
log_calls: bool,
|
172
207
|
default_path: Optional[List[str]],
|
@@ -189,6 +224,8 @@ def robotcode(
|
|
189
224
|
app.config.profiles = profiles
|
190
225
|
app.config.dry = dry
|
191
226
|
app.config.verbose = verbose
|
227
|
+
app.config.root = root
|
228
|
+
app.config.no_vcs = no_vcs
|
192
229
|
|
193
230
|
if color is None:
|
194
231
|
app.config.colored_output = ColoredOutput.AUTO
|
@@ -210,7 +247,8 @@ def robotcode(
|
|
210
247
|
|
211
248
|
logging.basicConfig(
|
212
249
|
level=log_level,
|
213
|
-
format=
|
250
|
+
format=log_format,
|
251
|
+
style=log_style,
|
214
252
|
filename=log_filename,
|
215
253
|
)
|
216
254
|
|
@@ -240,9 +278,8 @@ def robotcode(
|
|
240
278
|
robotcode.add_command(config)
|
241
279
|
robotcode.add_command(profiles)
|
242
280
|
|
243
|
-
for
|
244
|
-
|
245
|
-
robotcode.add_command(c)
|
281
|
+
for c in PluginManager.instance().cli_commands:
|
282
|
+
robotcode.add_command(c)
|
246
283
|
|
247
284
|
|
248
285
|
@robotcode.command()
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.93.0"
|
@@ -2,7 +2,7 @@ import dataclasses
|
|
2
2
|
import os
|
3
3
|
from fnmatch import fnmatchcase
|
4
4
|
from pathlib import Path
|
5
|
-
from typing import Any, Dict, List, Optional
|
5
|
+
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union, get_args, get_origin
|
6
6
|
|
7
7
|
import click
|
8
8
|
|
@@ -20,11 +20,9 @@ from robotcode.robot.config.loader import (
|
|
20
20
|
load_robot_config_from_path,
|
21
21
|
)
|
22
22
|
from robotcode.robot.config.model import (
|
23
|
-
|
24
|
-
RebotProfile,
|
23
|
+
BaseOptions,
|
25
24
|
RobotConfig,
|
26
25
|
RobotProfile,
|
27
|
-
TestDocProfile,
|
28
26
|
)
|
29
27
|
from robotcode.robot.config.utils import get_config_files
|
30
28
|
|
@@ -66,11 +64,21 @@ def show(app: Application, single: bool, paths: List[Path]) -> None:
|
|
66
64
|
```
|
67
65
|
"""
|
68
66
|
try:
|
69
|
-
config_files, _, _ = get_config_files(
|
67
|
+
config_files, _, _ = get_config_files(
|
68
|
+
paths,
|
69
|
+
app.config.config_files,
|
70
|
+
root_folder=app.config.root,
|
71
|
+
no_vcs=app.config.no_vcs,
|
72
|
+
verbose_callback=app.verbose,
|
73
|
+
)
|
70
74
|
|
71
75
|
if single:
|
72
76
|
for file, _ in config_files:
|
73
|
-
config = load_robot_config_from_path(
|
77
|
+
config = load_robot_config_from_path(
|
78
|
+
file,
|
79
|
+
extra_tools={k: v for k, v in PluginManager.instance().tool_config_classes},
|
80
|
+
verbose_callback=app.verbose,
|
81
|
+
)
|
74
82
|
click.secho(f"File: {file}")
|
75
83
|
app.print_data(
|
76
84
|
config,
|
@@ -80,7 +88,11 @@ def show(app: Application, single: bool, paths: List[Path]) -> None:
|
|
80
88
|
|
81
89
|
return
|
82
90
|
|
83
|
-
config = load_robot_config_from_path(
|
91
|
+
config = load_robot_config_from_path(
|
92
|
+
*config_files,
|
93
|
+
extra_tools={k: v for k, v in PluginManager.instance().tool_config_classes},
|
94
|
+
verbose_callback=app.verbose,
|
95
|
+
)
|
84
96
|
|
85
97
|
app.print_data(
|
86
98
|
config,
|
@@ -117,7 +129,13 @@ def files(app: Application, paths: List[Path], user: bool = False) -> None:
|
|
117
129
|
"""
|
118
130
|
|
119
131
|
try:
|
120
|
-
config_files, _, discovered_by = get_config_files(
|
132
|
+
config_files, _, discovered_by = get_config_files(
|
133
|
+
paths,
|
134
|
+
app.config.config_files,
|
135
|
+
root_folder=app.config.root,
|
136
|
+
no_vcs=app.config.no_vcs,
|
137
|
+
verbose_callback=app.verbose,
|
138
|
+
)
|
121
139
|
|
122
140
|
result: Dict[str, Any] = {"files": [{"path": str(file), "type": type} for file, type in config_files]}
|
123
141
|
|
@@ -147,7 +165,7 @@ def files(app: Application, paths: List[Path], user: bool = False) -> None:
|
|
147
165
|
required=False,
|
148
166
|
)
|
149
167
|
@pass_application
|
150
|
-
def root(app: Application, paths:
|
168
|
+
def root(app: Application, paths: Tuple[Path, ...]) -> None:
|
151
169
|
"""\
|
152
170
|
Searches for the root folder of the project and prints them.
|
153
171
|
|
@@ -162,7 +180,9 @@ def root(app: Application, paths: List[Path]) -> None:
|
|
162
180
|
```
|
163
181
|
"""
|
164
182
|
|
165
|
-
root_folder, discovered_by = find_project_root(
|
183
|
+
root_folder, discovered_by = find_project_root(
|
184
|
+
*(paths or []), root_folder=app.config.root, no_vcs=app.config.no_vcs
|
185
|
+
)
|
166
186
|
|
167
187
|
if root_folder is None and (app.config.output_format is None or app.config.output_format == OutputFormat.TEXT):
|
168
188
|
raise click.ClickException("Cannot detect root folder. 😥")
|
@@ -193,55 +213,51 @@ def info(app: Application) -> None:
|
|
193
213
|
"""Shows informations about possible configuration settings."""
|
194
214
|
|
195
215
|
|
196
|
-
def
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
216
|
+
def type_to_str(t: Union[Type[Any], str]) -> str:
|
217
|
+
if isinstance(t, str):
|
218
|
+
return f"'{t}'"
|
219
|
+
|
220
|
+
origin = get_origin(t)
|
221
|
+
if origin is None:
|
222
|
+
return t.__name__
|
223
|
+
|
224
|
+
if origin is Union:
|
225
|
+
return " | ".join(type_to_str(a) for a in get_args(t))
|
204
226
|
|
205
|
-
for
|
206
|
-
|
207
|
-
|
227
|
+
return f"{origin.__name__}[{', '.join(type_to_str(a) for a in get_args(t))}]"
|
228
|
+
|
229
|
+
|
230
|
+
def _get_config_fields_for_type(
|
231
|
+
prefix: str, cls: Type[Any], filter: Optional[Callable[[str], bool]] = None
|
232
|
+
) -> Dict[str, Dict[str, str]]:
|
233
|
+
result = {}
|
234
|
+
for field in dataclasses.fields(cls):
|
235
|
+
field_name_encoded = encode_case_for_field_name(cls, field)
|
236
|
+
if filter and not filter(field_name_encoded):
|
208
237
|
continue
|
209
238
|
|
210
|
-
result[
|
211
|
-
"type":
|
239
|
+
result[prefix + field_name_encoded] = {
|
240
|
+
"type": type_to_str(field.type),
|
212
241
|
"description": field.metadata.get("description", "").strip(),
|
213
242
|
}
|
243
|
+
args = get_args(field.type)
|
214
244
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
245
|
+
p = f"{prefix}{'' if prefix[-1]=='.' else '.'}" if prefix else ""
|
246
|
+
for a in args:
|
247
|
+
origin = get_origin(a)
|
248
|
+
if origin is None and issubclass(a, BaseOptions):
|
249
|
+
result.update(_get_config_fields_for_type(f"{p}{field_name_encoded}.", a, filter))
|
250
|
+
return result
|
221
251
|
|
222
|
-
for field in dataclasses.fields(LibDocProfile):
|
223
|
-
field_name_encoded = encode_case_for_field_name(LibDocProfile, field)
|
224
|
-
result["libdoc." + field_name_encoded] = {
|
225
|
-
"type": str(field.type),
|
226
|
-
"description": field.metadata.get("description", "").strip(),
|
227
|
-
}
|
228
252
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
"type": str(field.type),
|
233
|
-
"description": field.metadata.get("description", "").strip(),
|
234
|
-
}
|
253
|
+
def get_config_fields() -> Dict[str, Dict[str, str]]:
|
254
|
+
result = {}
|
255
|
+
result.update(_get_config_fields_for_type("", RobotConfig))
|
235
256
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
field_name_encoded = encode_case_for_field_name(TestDocProfile, field)
|
241
|
-
result[f"{s}." + field_name_encoded] = {
|
242
|
-
"type": str(field.type),
|
243
|
-
"description": field.metadata.get("description", "").strip(),
|
244
|
-
}
|
257
|
+
result.update(_get_config_fields_for_type("[profile].", RobotProfile, lambda x: x not in result))
|
258
|
+
for entry in PluginManager.instance().tool_config_classes:
|
259
|
+
if dataclasses.is_dataclass(entry.config_class):
|
260
|
+
result.update(_get_config_fields_for_type(f"tool.{entry.tool_name}.", entry.config_class))
|
245
261
|
|
246
262
|
return {k: v for k, v in sorted(result.items(), key=lambda item: item[0])}
|
247
263
|
|
@@ -275,7 +291,15 @@ def list(app: Application, name: Optional[List[str]] = None) -> None:
|
|
275
291
|
result.append(field)
|
276
292
|
|
277
293
|
if app.config.output_format is None or app.config.output_format == OutputFormat.TEXT:
|
278
|
-
|
294
|
+
|
295
|
+
def output() -> Iterable[str]:
|
296
|
+
for r in result:
|
297
|
+
yield r + os.linesep
|
298
|
+
|
299
|
+
yield os.linesep
|
300
|
+
yield f"Total: {len(result)}"
|
301
|
+
|
302
|
+
app.echo_via_pager(output())
|
279
303
|
else:
|
280
304
|
app.print_data({"names": result})
|
281
305
|
|
@@ -40,9 +40,11 @@ def profiles() -> None:
|
|
40
40
|
def show(app: Application, no_evaluate: bool, paths: List[Path]) -> None:
|
41
41
|
"""Shows the given profile configuration."""
|
42
42
|
try:
|
43
|
-
config_files, _, _ = get_config_files(
|
43
|
+
config_files, _, _ = get_config_files(
|
44
|
+
paths, app.config.config_files, root_folder=app.config.root, verbose_callback=app.verbose
|
45
|
+
)
|
44
46
|
|
45
|
-
config = load_robot_config_from_path(*config_files).combine_profiles(
|
47
|
+
config = load_robot_config_from_path(*config_files, verbose_callback=app.verbose).combine_profiles(
|
46
48
|
*(app.config.profiles or []), verbose_callback=app.verbose, error_callback=app.error
|
47
49
|
)
|
48
50
|
|
@@ -73,9 +75,15 @@ def list(app: Application, paths: List[Path], show_hidden: bool = False, sort_by
|
|
73
75
|
"""Lists the defined profiles in the current configuration."""
|
74
76
|
|
75
77
|
try:
|
76
|
-
config_files, _, discovered_by = get_config_files(
|
78
|
+
config_files, _, discovered_by = get_config_files(
|
79
|
+
paths,
|
80
|
+
app.config.config_files,
|
81
|
+
root_folder=app.config.root,
|
82
|
+
no_vcs=app.config.no_vcs,
|
83
|
+
verbose_callback=app.verbose,
|
84
|
+
)
|
77
85
|
|
78
|
-
config = load_robot_config_from_path(*config_files)
|
86
|
+
config = load_robot_config_from_path(*config_files, verbose_callback=app.verbose)
|
79
87
|
|
80
88
|
_, selected_profiles, enabled_names = config.combine_profiles_ex(
|
81
89
|
*(app.config.profiles or []), verbose_callback=app.verbose, error_callback=app.error
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.91.0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|