Skip to content

Commit 6bbadba

Browse files
authored
Update EditorConfig config (#74)
Include settings for - Rust files - TOML - Change SCM indentation from 4 to 2 to match tree-sitter
1 parent ec7c1ef commit 6bbadba

File tree

4 files changed

+57
-40
lines changed

4 files changed

+57
-40
lines changed

.editorconfig

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
root = true
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.rs]
11+
indent_size = 4
12+
indent_style = space
13+
14+
[*.toml]
15+
indent_size = 2
16+
indent_style = space
17+
118
[*.scm]
219
indent_style = space
3-
indent_size = 4
20+
indent_size = 2

languages/erb/injections.scm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
((code) @content
2-
(#set! "language" "ruby")
3-
(#set! "combined"))
2+
(#set! "language" "ruby")
3+
(#set! "combined"))
44

55
((content) @content
6-
(#set! "language" "html")
7-
(#set! "combined"))
6+
(#set! "language" "html")
7+
(#set! "combined"))

languages/ruby/highlights.scm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
] @keyword
3838

3939
((identifier) @keyword
40-
(#match? @keyword "^(private|protected|public)$"))
40+
(#match? @keyword "^(private|protected|public)$"))
4141

4242
; Function calls
4343

@@ -68,7 +68,7 @@
6868
; Identifiers
6969

7070
((identifier) @constant.builtin
71-
(#match? @constant.builtin "^__(FILE|LINE|ENCODING)__$"))
71+
(#match? @constant.builtin "^__(FILE|LINE|ENCODING)__$"))
7272

7373
(file) @constant.builtin
7474
(line) @constant.builtin
@@ -81,7 +81,7 @@
8181
(constant) @type
8282

8383
((constant) @constant
84-
(#match? @constant "^[A-Z\\d_]+$"))
84+
(#match? @constant "^[A-Z\\d_]+$"))
8585

8686
(superclass
8787
(constant) @type.super)

languages/ruby/runnables.scm

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,55 @@
44

55
; Tests that inherit from a specific class
66
(
7-
(class
8-
name: [
9-
(constant) @run
10-
(scope_resolution scope: (constant) name: (constant) @run)
11-
]
12-
(superclass (scope_resolution) @superclass (#match? @superclass "(::IntegrationTest|::TestCase|::SystemTestCase|Minitest::Test|TLDR)$"))
13-
) @_ruby-test
14-
(#set! tag ruby-test)
7+
(class
8+
name: [
9+
(constant) @run
10+
(scope_resolution scope: (constant) name: (constant) @run)
11+
]
12+
(superclass (scope_resolution) @superclass (#match? @superclass "(::IntegrationTest|::TestCase|::SystemTestCase|Minitest::Test|TLDR)$"))
13+
) @_ruby-test
14+
(#set! tag ruby-test)
1515
)
1616

1717
(
18-
(call
19-
method: (identifier) @run (#eq? @run "test")
20-
arguments: (argument_list (string (string_content) @_name))
21-
) @_ruby-test
22-
(#set! tag ruby-test)
18+
(call
19+
method: (identifier) @run (#eq? @run "test")
20+
arguments: (argument_list (string (string_content) @_name))
21+
) @_ruby-test
22+
(#set! tag ruby-test)
2323
)
2424

2525
; Methods that begin with test_
2626
(
27-
(method
28-
name: (identifier) @run (#match? @run "^test_")
29-
) @_ruby-test
30-
(#set! tag ruby-test)
27+
(method
28+
name: (identifier) @run (#match? @run "^test_")
29+
) @_ruby-test
30+
(#set! tag ruby-test)
3131
)
3232

3333
; System tests that inherit from ApplicationSystemTestCase
3434
(
35-
(class
36-
name: (constant) @run (superclass) @superclass (#match? @superclass "(ApplicationSystemTestCase)$")
37-
) @_ruby-test
38-
(#set! tag ruby-test)
35+
(class
36+
name: (constant) @run (superclass) @superclass (#match? @superclass "(ApplicationSystemTestCase)$")
37+
) @_ruby-test
38+
(#set! tag ruby-test)
3939
)
4040

4141
; Examples
4242
(
43-
(call
44-
method: (identifier) @run (#any-of? @run "describe" "context" "it" "its" "specify")
45-
arguments: (argument_list . (_) @_name)
46-
) @_ruby-test
47-
(#set! tag ruby-test)
43+
(call
44+
method: (identifier) @run (#any-of? @run "describe" "context" "it" "its" "specify")
45+
arguments: (argument_list . (_) @_name)
46+
) @_ruby-test
47+
(#set! tag ruby-test)
4848
)
4949

5050
; Examples (one-liner syntax)
5151
(
52-
(call
53-
method: (identifier) @run (#any-of? @run "it" "its" "specify")
54-
block: (_) @_name
55-
!arguments
56-
) @_ruby-test
57-
(#set! tag ruby-test)
52+
(call
53+
method: (identifier) @run (#any-of? @run "it" "its" "specify")
54+
block: (_) @_name
55+
!arguments
56+
) @_ruby-test
57+
(#set! tag ruby-test)
5858
)

0 commit comments

Comments
 (0)