mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
Add support for Robot Framework files with robotidy
(#263)
This commit is contained in:
parent
5e894a270b
commit
56651724ad
6 changed files with 56 additions and 0 deletions
|
@ -11,8 +11,11 @@ The format is based on [Keep a Changelog].
|
||||||
[HTML](https://en.wikipedia.org/wiki/HTML) and
|
[HTML](https://en.wikipedia.org/wiki/HTML) and
|
||||||
[CSS](https://www.google.com/search?q=css)
|
[CSS](https://www.google.com/search?q=css)
|
||||||
([#229])
|
([#229])
|
||||||
|
* [`robotidy`](https://robotidy.readthedocs.io) for Robot Framework files
|
||||||
|
([#263]).
|
||||||
|
|
||||||
[#229]: https://github.com/radian-software/apheleia/pull/229
|
[#229]: https://github.com/radian-software/apheleia/pull/229
|
||||||
|
[#263]: https://github.com/radian-software/apheleia/pull/263
|
||||||
|
|
||||||
## 4.0 (released 2023-11-23)
|
## 4.0 (released 2023-11-23)
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|
|
@ -136,6 +136,9 @@
|
||||||
"--parser=yaml"
|
"--parser=yaml"
|
||||||
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
|
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
|
||||||
(purs-tidy . ("apheleia-npx" "purs-tidy" "format"))
|
(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"
|
(rubocop . ("rubocop" "--stdin" filepath "--auto-correct"
|
||||||
"--stderr" "--format" "quiet" "--fail-level" "fatal"))
|
"--stderr" "--format" "quiet" "--fail-level" "fatal"))
|
||||||
(ruby-standard . ("standardrb" "--stdin" filepath "--fix" "--stderr"
|
(ruby-standard . ("standardrb" "--stdin" filepath "--fix" "--stderr"
|
||||||
|
@ -306,6 +309,7 @@ rather than using this system."
|
||||||
(purescript-mode . purs-tidy)
|
(purescript-mode . purs-tidy)
|
||||||
(python-mode . black)
|
(python-mode . black)
|
||||||
(python-ts-mode . black)
|
(python-ts-mode . black)
|
||||||
|
(robot-mode . robotidy)
|
||||||
(ruby-mode . prettier-ruby)
|
(ruby-mode . prettier-ruby)
|
||||||
(ruby-ts-mode . prettier-ruby)
|
(ruby-ts-mode . prettier-ruby)
|
||||||
(rustic-mode . rustfmt)
|
(rustic-mode . rustfmt)
|
||||||
|
|
|
@ -46,6 +46,7 @@ always returns nil to defer to the formatter."
|
||||||
(json-mode 'js-indent-level)
|
(json-mode 'js-indent-level)
|
||||||
(json-ts-mode 'json-ts-mode-indent-offset)
|
(json-ts-mode 'json-ts-mode-indent-offset)
|
||||||
(nxml-mode 'nxml-child-indent)
|
(nxml-mode 'nxml-child-indent)
|
||||||
|
(robot-mode 'robot-mode-basic-offset)
|
||||||
(scss-mode 'css-indent-offset)
|
(scss-mode 'css-indent-offset)
|
||||||
(web-mode 'web-mode-indent-style)
|
(web-mode 'web-mode-indent-style)
|
||||||
(tsx-ts-mode 'typescript-ts-mode-indent-offset)
|
(tsx-ts-mode 'typescript-ts-mode-indent-offset)
|
||||||
|
|
2
test/formatters/installers/robotidy.bash
Normal file
2
test/formatters/installers/robotidy.bash
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
apt-get install -y python3-pip
|
||||||
|
python3 -m pip install robotframework-tidy
|
22
test/formatters/samplecode/robotidy/in.robot
Normal file
22
test/formatters/samplecode/robotidy/in.robot
Normal 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 ***
|
24
test/formatters/samplecode/robotidy/out.robot
Normal file
24
test/formatters/samplecode/robotidy/out.robot
Normal 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue