File tree 5 files changed +38
-0
lines changed
test/fixtures/code_samples
5 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ $ gcloc languages
191
191
PowerShell | .ps1 | # |
192
192
Processing | .pde | // | /* */
193
193
Protocol Buffers | .proto | // |
194
+ PRQL | .prql | # |
194
195
Python | .py | # | """ """
195
196
R | .r .R | # |
196
197
Rego | .rego | # |
Original file line number Diff line number Diff line change @@ -183,6 +183,11 @@ var Languages = language.Languages{
183
183
MultiLineComments : [][]string {{"\" \" \" " , "\" \" \" " }},
184
184
Extensions : []string {".py" },
185
185
},
186
+ "PRQL" : {
187
+ LineComments : []string {"#" },
188
+ MultiLineComments : [][]string {},
189
+ Extensions : []string {".prql" },
190
+ },
186
191
"R" : {
187
192
LineComments : []string {"#" },
188
193
MultiLineComments : [][]string {},
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ func TestMatchingFiles(t *testing.T) {
92
92
Extension : ".py" ,
93
93
Language : "Python" ,
94
94
},
95
+ {
96
+ FilePath : filepath .Join (codeSamplesDir , "example.prql" ),
97
+ Extension : ".prql" ,
98
+ Language : "PRQL" ,
99
+ },
95
100
{
96
101
FilePath : filepath .Join (codeSamplesDir , "main.rb" ),
97
102
Extension : ".rb" ,
@@ -189,6 +194,11 @@ func TestMatchingFiles(t *testing.T) {
189
194
Extension : ".py" ,
190
195
Language : "Python" ,
191
196
},
197
+ {
198
+ FilePath : filepath .Join (codeSamplesDir , "example.prql" ),
199
+ Extension : ".prql" ,
200
+ Language : "PRQL" ,
201
+ },
192
202
{
193
203
FilePath : filepath .Join (codeSamplesDir , "main.rb" ),
194
204
Extension : ".rb" ,
@@ -287,6 +297,11 @@ func TestMatchingFiles(t *testing.T) {
287
297
Extension : ".py" ,
288
298
Language : "Python" ,
289
299
},
300
+ {
301
+ FilePath : filepath .Join (codeSamplesDir , "example.prql" ),
302
+ Extension : ".prql" ,
303
+ Language : "PRQL" ,
304
+ },
290
305
{
291
306
FilePath : filepath .Join (codeSamplesDir , "main.rb" ),
292
307
Extension : ".rb" ,
Original file line number Diff line number Diff line change @@ -113,6 +113,11 @@ func TestScan(t *testing.T) {
113
113
Extension : ".txt" ,
114
114
Language : "Plain Text" ,
115
115
},
116
+ {
117
+ FilePath : filepath .Join (codeSamplesDir , "example.prql" ),
118
+ Extension : ".prql" ,
119
+ Language : "PRQL" ,
120
+ },
116
121
}
117
122
118
123
expected := []scanResult {
@@ -242,6 +247,13 @@ func TestScan(t *testing.T) {
242
247
BlankLines : 13 ,
243
248
Comments : 0 ,
244
249
},
250
+ {
251
+ Metadata : files [18 ],
252
+ Lines : 5 ,
253
+ CodeLines : 4 ,
254
+ BlankLines : 0 ,
255
+ Comments : 1 ,
256
+ },
245
257
}
246
258
247
259
result , err := scanner .Scan (files )
Original file line number Diff line number Diff line change
1
+ # This is a comment
2
+ from track_plays
3
+ filter plays > 10_000
4
+ sort length
5
+ take 10
You can’t perform that action at this time.
0 commit comments