Add support for Robot Framework files with robotidy (#263)

This commit is contained in:
Ville Skyttä 2023-11-29 00:50:25 +02:00 committed by GitHub
parent 5e894a270b
commit 56651724ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 0 deletions

View file

@ -11,8 +11,11 @@ The format is based on [Keep a Changelog].
[HTML](https://en.wikipedia.org/wiki/HTML) and
[CSS](https://www.google.com/search?q=css)
([#229])
* [`robotidy`](https://robotidy.readthedocs.io) for Robot Framework files
([#263]).
[#229]: https://github.com/radian-software/apheleia/pull/229
[#263]: https://github.com/radian-software/apheleia/pull/263
## 4.0 (released 2023-11-23)
### Breaking changes

View file

@ -136,6 +136,9 @@
"--parser=yaml"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(purs-tidy . ("apheleia-npx" "purs-tidy" "format"))
(robotidy . ("robotidy" "--no-color" "-"
(apheleia-formatters-indent nil "--indent")
(apheleia-formatters-fill-column "--line-length")))
(rubocop . ("rubocop" "--stdin" filepath "--auto-correct"
"--stderr" "--format" "quiet" "--fail-level" "fatal"))
(ruby-standard . ("standardrb" "--stdin" filepath "--fix" "--stderr"
@ -306,6 +309,7 @@ rather than using this system."
(purescript-mode . purs-tidy)
(python-mode . black)
(python-ts-mode . black)
(robot-mode . robotidy)
(ruby-mode . prettier-ruby)
(ruby-ts-mode . prettier-ruby)
(rustic-mode . rustfmt)

View file

@ -46,6 +46,7 @@ always returns nil to defer to the formatter."
(json-mode 'js-indent-level)
(json-ts-mode 'json-ts-mode-indent-offset)
(nxml-mode 'nxml-child-indent)
(robot-mode 'robot-mode-basic-offset)
(scss-mode 'css-indent-offset)
(web-mode 'web-mode-indent-style)
(tsx-ts-mode 'typescript-ts-mode-indent-offset)

View file

@ -0,0 +1,2 @@
apt-get install -y python3-pip
python3 -m pip install robotframework-tidy

View file

@ -0,0 +1,22 @@
Force Tags tags tag2
Library Collections
Resource important.robot
Library MyCustomLibrary.py
Test Setup Setup Keyword
*** test case*
Test1
[ teardown] Teardown Keyword
Keyword
FOR ${var} IN RANGE 10
Run Keyword If ${var}>5 Other Keyword
END
*** Variables ***
${var}= 2
${bit_longer} 10
${var2} a
... b
*** Keywords ***

View file

@ -0,0 +1,24 @@
*** Comments ***
Force Tags tags tag2
Library Collections
Resource important.robot
Library MyCustomLibrary.py
Test Setup Setup Keyword
*** Variables ***
${var}= 2
${bit_longer} 10
${var2} a
... b
*** Test Cases ***
Test1
Keyword
FOR ${var} IN RANGE 10
IF ${var}>5 Other Keyword
END
[Teardown] Teardown Keyword