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

Add .resource extension to Robot Framework #6500

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/linguist/generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extensions:
- ".9"
- ".app"
- ".cmp"
- ".resource"
- ".sol"
- ".stl"
- ".tag"
Expand Down
5 changes: 5 additions & 0 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ disambiguations:
pattern:
- '^\s*(let|module|type)\s+\w*\s+=\s+'
- '^\s*(?:include|open)\s+\w+\s*$'
- extensions: ['.resource']
rules:
- language: RobotFramework
pattern:
- '^\*{3} (Settings|Variables|Keywords) \*{3}$'
- extensions: ['.rno']
rules:
- language: RUNOFF
Expand Down
1 change: 1 addition & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6207,6 +6207,7 @@ RobotFramework:
color: "#00c0b5"
extensions:
- ".robot"
- ".resource"
tm_scope: text.robot
ace_mode: text
language_id: 324
Expand Down
21 changes: 21 additions & 0 deletions samples/RobotFramework/keywords.resource
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*** Settings ***
Documentation Example keywords file.
... It is recommended to use another ending than `.robot` for resource files.
... By convention, the file ending for resource files is `.resource`.
... Another resource than `.robot` makes maintaining large projects easier. It also prevents
... the parser to search for tasks or test cases in resource files, which saves some startup performance.

Library Collections


*** Variables ***
${variable} ${EMPTY}
${some_list} @{EMPTY}
${some_dict} &{EMPTY}


*** Keywords ***
Dictionary Should Contain ${key}=${value}
[Arguments] ${dict}
Dictionary Should Contain Key ${dict} ${key}
Should Be Equal ${dict}[key] ${value} msg=Dictionary does not hold expected item.
6 changes: 6 additions & 0 deletions test/test_heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,12 @@ def test_res_by_heuristics
})
end

def test_resource_by_heuristics
assert_heuristics({
"RobotFramework" => all_fixtures("RobotFramework", "*.resource")
})
end

def test_rno_by_heuristics
assert_heuristics({
"RUNOFF" => all_fixtures("RUNOFF", "*.rno"),
Expand Down
Loading