Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incorrect formatting of Robot test script every second time #361

Open
Markus537 opened this issue Nov 28, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Markus537
Copy link

Markus537 commented Nov 28, 2024

Type: Bug

Given the following minimal test description:

*** Test Cases ***
Test
   Embedded "args"


*** Keywords ***
Embedded "${args}"
   No Operation

When I reformat this from within VsCode using the corresponding keyboard shortcut <Shift><Ctrl>I, every second time an extra blank line is inserted before the keywords section. When the extra blank line is inserted, reformatting the document removes the blank line again.

My robotidy configuration in pyproject.toml is as follows:

[tool.robotidy]
spacecount = 3
transform = [
   "NormalizeSectionHeaderName",
   "NormalizeNewLines",
   "NormalizeSettingName",
   "NormalizeSeparators",
   "RemoveEmptySettings",
   "OrderSettings",
   "OrderSettingsSection"
]
configure = [
    "NormalizeAssignments: equal_sign_type=space_and_equal_sign",
    "NormalizeAssignments: equal_sign_type_variables=space_and_equal_sign",
    "NormalizeNewLines: section_lines=2",
    "NormalizeNewLines: keyword_lines=1",
    "NormalizeNewLines: test_case_lines=1",
    "NormalizeNewLines: separate_templated_tests=True",
    "NormalizeNewLines: consecutive_lines=1",
    "OrderSettings: keyword_before=documentation,tags,timeout,arguments",
    "OrderSettings: keyword_after=return",
    "OrderSettingsSection: group_order=documentation,tags,imports,settings",
    "OrderSettingsSection: imports_order=resource,library,variables"
]

Executing robotidy directly from the command line doesn't show this behaviour.

There is nothing special to be seen in the output of the RobotCode extension:

executeRobotCode: /home/.../.venv/bin/python -u -X utf8 /home/.../.vscode/extensions/d-biehl.robotcode-0.99.0/bundled/tool/robotcode --format json --no-color --no-pager --default-path . discover --read-from-stdin tests -P libraries/ --argumentfile=arguments.arg --parse-include test.robot --suite Test Robot Scripts.Test
executeRobotCode: exit code 0

Extension version: 0.99.0
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Linux x64 4.18.0-553.27.1.el8_10.x86_64
Modes:

System Info
Item Value
CPUs Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz (4 x 0)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
webnn: unavailable_software
Load (avg) 1, 1, 1
Memory (System) 15.39GB (6.96GB free)
Process Argv . --log streetsidesoftware.code-spell-checker=trace
Screen Reader no
VM 100%
DESKTOP_SESSION gnome-xorg
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome-xorg
XDG_SESSION_TYPE x11
@d-biehl
Copy link
Member

d-biehl commented Dec 8, 2024

I can reproduce it, I will investigate.

@d-biehl d-biehl changed the title Incorrect formatting of Robot test script every second time [Bug] Incorrect formatting of Robot test script every second time Dec 8, 2024
@d-biehl d-biehl changed the title [Bug] Incorrect formatting of Robot test script every second time [BUG] Incorrect formatting of Robot test script every second time Dec 8, 2024
@d-biehl d-biehl added the bug Something isn't working label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants