at_coder_friends 0.6.3 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +3 -2
- data/.travis.yml +1 -3
- data/CHANGELOG.md +37 -0
- data/Gemfile.lock +53 -48
- data/README.md +1 -1
- data/at_coder_friends.gemspec +5 -7
- data/config/default.yml +146 -72
- data/docs/CONFIGURATION.md +222 -136
- data/lib/at_coder_friends.rb +1 -0
- data/lib/at_coder_friends/cli.rb +8 -0
- data/lib/at_coder_friends/config_loader.rb +11 -3
- data/lib/at_coder_friends/context.rb +10 -6
- data/lib/at_coder_friends/emitter.rb +2 -2
- data/lib/at_coder_friends/generator/base.rb +3 -2
- data/lib/at_coder_friends/generator/main.rb +2 -1
- data/lib/at_coder_friends/parser/constraints.rb +1 -0
- data/lib/at_coder_friends/parser/input_format.rb +2 -0
- data/lib/at_coder_friends/parser/input_type.rb +3 -2
- data/lib/at_coder_friends/parser/modulo.rb +1 -1
- data/lib/at_coder_friends/parser/sections.rb +3 -3
- data/lib/at_coder_friends/path_info.rb +51 -0
- data/lib/at_coder_friends/path_util.rb +0 -31
- data/lib/at_coder_friends/scraping/agent.rb +11 -2
- data/lib/at_coder_friends/scraping/custom_test.rb +5 -6
- data/lib/at_coder_friends/scraping/submission.rb +6 -7
- data/lib/at_coder_friends/scraping/tasks.rb +8 -3
- data/lib/at_coder_friends/test_runner/base.rb +17 -4
- data/lib/at_coder_friends/test_runner/judge.rb +7 -9
- data/lib/at_coder_friends/test_runner/sample.rb +2 -4
- data/lib/at_coder_friends/verifier.rb +2 -3
- data/lib/at_coder_friends/version.rb +1 -1
- data/templates/cxx_builtin.cxx.erb +26 -35
- data/templates/ruby_builtin.rb.erb +17 -18
- metadata +7 -16
- data/tasks/regression/check_const.rake +0 -137
- data/tasks/regression/check_diff.rake +0 -30
- data/tasks/regression/check_fmt.rake +0 -45
- data/tasks/regression/check_parse.rake +0 -69
- data/tasks/regression/list_handler.rb +0 -46
- data/tasks/regression/regression.rb +0 -38
- data/tasks/regression/report_handler.rb +0 -20
- data/tasks/regression/section_list.rake +0 -53
- data/tasks/regression/setup.rake +0 -48
data/docs/CONFIGURATION.md
CHANGED
@@ -29,91 +29,165 @@ generators:
|
|
29
29
|
- RubyBuiltin
|
30
30
|
- CxxBuiltin
|
31
31
|
ext_settings:
|
32
|
-
'awk':
|
33
|
-
submit_lang:
|
34
|
-
|
35
|
-
|
36
|
-
'
|
37
|
-
submit_lang:
|
32
|
+
'awk': # Awk (mawk)
|
33
|
+
submit_lang:
|
34
|
+
- '4009'
|
35
|
+
- '3506'
|
36
|
+
'bf': # Brainfuck
|
37
|
+
submit_lang:
|
38
|
+
- '4062'
|
39
|
+
- '3507'
|
40
|
+
'c': # C (GCC)
|
41
|
+
submit_lang:
|
42
|
+
- '4001'
|
43
|
+
- '3002'
|
38
44
|
test_cmd:
|
39
45
|
default: '"{dir}/{base}"'
|
40
46
|
windows: '"{dir}/{base}.exe"'
|
41
|
-
'cbl':
|
42
|
-
submit_lang:
|
43
|
-
|
44
|
-
|
45
|
-
'
|
46
|
-
submit_lang:
|
47
|
-
|
48
|
-
|
47
|
+
'cbl': # COBOL - Free
|
48
|
+
submit_lang:
|
49
|
+
- '4061'
|
50
|
+
- '3526'
|
51
|
+
'clj': # Clojure
|
52
|
+
submit_lang:
|
53
|
+
- '4013'
|
54
|
+
- '3007'
|
55
|
+
'cr': # Crystal
|
56
|
+
submit_lang:
|
57
|
+
- '4014'
|
58
|
+
- '3511'
|
59
|
+
'cs': # C# (Mono-mcs)
|
60
|
+
submit_lang:
|
61
|
+
- '4011'
|
62
|
+
- '3006'
|
49
63
|
test_cmd:
|
50
64
|
default: 'mono "{dir}/{base}.exe"'
|
51
65
|
windows: '"{dir}/{base}.exe"'
|
52
|
-
'cxx':
|
53
|
-
submit_lang:
|
66
|
+
'cxx': # C++ (GCC)
|
67
|
+
submit_lang:
|
68
|
+
- '4003'
|
69
|
+
- '3003'
|
54
70
|
test_cmd:
|
55
71
|
default: '"{dir}/{base}"'
|
56
72
|
windows: '"{dir}/{base}.exe"'
|
57
|
-
'd':
|
58
|
-
submit_lang:
|
59
|
-
|
60
|
-
|
61
|
-
'
|
62
|
-
submit_lang: '
|
63
|
-
'
|
64
|
-
submit_lang:
|
65
|
-
|
66
|
-
|
67
|
-
'
|
68
|
-
submit_lang:
|
73
|
+
'd': # D (DMD64)
|
74
|
+
submit_lang:
|
75
|
+
- '4015'
|
76
|
+
- '3009'
|
77
|
+
'dart': # Dart
|
78
|
+
submit_lang: '4018'
|
79
|
+
'f90': # Fortran (gfortran)
|
80
|
+
submit_lang:
|
81
|
+
- '4025'
|
82
|
+
- '3012'
|
83
|
+
'fs': # F# (Mono)
|
84
|
+
submit_lang:
|
85
|
+
- '4023'
|
86
|
+
- '3512'
|
87
|
+
'go': # Go
|
88
|
+
submit_lang:
|
89
|
+
- '4026'
|
90
|
+
- '3013'
|
91
|
+
'hs': # Haskell (GHC)
|
92
|
+
submit_lang:
|
93
|
+
- '4027'
|
94
|
+
- '3014'
|
95
|
+
'java': # Java (OpenJDK)
|
96
|
+
submit_lang:
|
97
|
+
- '4005'
|
98
|
+
- '3016'
|
69
99
|
test_cmd:
|
70
100
|
default: 'java -cp "{dir}" Main'
|
71
|
-
'jl':
|
72
|
-
submit_lang:
|
73
|
-
|
74
|
-
|
75
|
-
'
|
76
|
-
submit_lang:
|
77
|
-
|
78
|
-
|
79
|
-
'
|
80
|
-
submit_lang:
|
81
|
-
|
82
|
-
|
83
|
-
'
|
84
|
-
submit_lang:
|
85
|
-
|
86
|
-
|
87
|
-
'
|
88
|
-
submit_lang:
|
89
|
-
|
90
|
-
|
91
|
-
'
|
92
|
-
submit_lang:
|
93
|
-
|
94
|
-
|
95
|
-
'
|
96
|
-
submit_lang:
|
101
|
+
'jl': # Julia
|
102
|
+
submit_lang:
|
103
|
+
- '4031'
|
104
|
+
- '3518'
|
105
|
+
'js': # JavaScript (node.js)
|
106
|
+
submit_lang:
|
107
|
+
- '4030'
|
108
|
+
- '3017'
|
109
|
+
'kt': # Kotlin
|
110
|
+
submit_lang:
|
111
|
+
- '4032'
|
112
|
+
- '3523'
|
113
|
+
'lisp': # Common Lisp
|
114
|
+
submit_lang:
|
115
|
+
- '4038'
|
116
|
+
- '3008'
|
117
|
+
'lua': # LuaJIT
|
118
|
+
submit_lang:
|
119
|
+
- '4034'
|
120
|
+
- '3515'
|
121
|
+
'm': # Octave
|
122
|
+
submit_lang:
|
123
|
+
- '4040'
|
124
|
+
- '3519'
|
125
|
+
'ml': # OCaml
|
126
|
+
submit_lang:
|
127
|
+
- '4039'
|
128
|
+
- '3018'
|
129
|
+
'nim': # Nim
|
130
|
+
submit_lang:
|
131
|
+
- '4036'
|
132
|
+
- '3520'
|
133
|
+
'pas': # Pascal (FPC)
|
134
|
+
submit_lang:
|
135
|
+
- '4041'
|
136
|
+
- '3019'
|
137
|
+
'php': # PHP7
|
138
|
+
submit_lang:
|
139
|
+
- '4044'
|
140
|
+
- '3524'
|
141
|
+
'pl': # Perl
|
142
|
+
submit_lang:
|
143
|
+
- '4042'
|
144
|
+
- '3020'
|
145
|
+
'py': # Python3
|
146
|
+
submit_lang:
|
147
|
+
- '4006'
|
148
|
+
- '3023'
|
149
|
+
'rb': # Ruby
|
150
|
+
submit_lang:
|
151
|
+
- '4049'
|
152
|
+
- '3024'
|
97
153
|
test_cmd:
|
98
154
|
default: 'ruby "{dir}/{base}.rb"'
|
99
|
-
'rs':
|
100
|
-
submit_lang:
|
101
|
-
|
102
|
-
|
103
|
-
'
|
104
|
-
submit_lang:
|
105
|
-
|
106
|
-
|
107
|
-
'
|
108
|
-
submit_lang:
|
109
|
-
|
110
|
-
|
111
|
-
'
|
112
|
-
submit_lang:
|
113
|
-
|
114
|
-
|
115
|
-
'
|
116
|
-
submit_lang:
|
155
|
+
'rs': # Rust
|
156
|
+
submit_lang:
|
157
|
+
- '4050'
|
158
|
+
- '3504'
|
159
|
+
'scala': # Scala
|
160
|
+
submit_lang:
|
161
|
+
- '4051'
|
162
|
+
- '3025'
|
163
|
+
'scm': # Scheme (Gauche)
|
164
|
+
submit_lang:
|
165
|
+
- '4053'
|
166
|
+
- '3026'
|
167
|
+
'sed': # Sed (GNU sed)
|
168
|
+
submit_lang:
|
169
|
+
- '4066'
|
170
|
+
- '3505'
|
171
|
+
'sh': # Bash (GNU bash)
|
172
|
+
submit_lang:
|
173
|
+
- '4007'
|
174
|
+
- '3001'
|
175
|
+
'swift': # Swift
|
176
|
+
submit_lang:
|
177
|
+
- '4055'
|
178
|
+
- '3503'
|
179
|
+
'ts': # TypeScript
|
180
|
+
submit_lang:
|
181
|
+
- '4057'
|
182
|
+
- '3521'
|
183
|
+
'txt': # Text (cat)
|
184
|
+
submit_lang:
|
185
|
+
- '4056'
|
186
|
+
- '3027'
|
187
|
+
'vb': # Visual Basic (Mono)
|
188
|
+
submit_lang:
|
189
|
+
- '4058'
|
190
|
+
- '3028'
|
117
191
|
```
|
118
192
|
|
119
193
|
## Configuration options
|
@@ -205,66 +279,78 @@ ext_settings:
|
|
205
279
|
|---------|-------------|---------|
|
206
280
|
|default_template|Source template file path|[/templates/cxx_builtin.cxx.erb](/templates/cxx_builtin.cxx.erb)|
|
207
281
|
|
208
|
-
### Language ID list (
|
282
|
+
### Language ID list (2020/06/21)
|
209
283
|
|
210
284
|
| Language ID | Description |
|
211
285
|
|-------------|-------------|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
286
|
+
|4001|C (GCC 9.2.1)|
|
287
|
+
|4002|C (Clang 10.0.0)|
|
288
|
+
|4003|C++ (GCC 9.2.1)|
|
289
|
+
|4004|C++ (Clang 10.0.0)|
|
290
|
+
|4005|Java (OpenJDK 11.0.6)|
|
291
|
+
|4006|Python (3.8.2)|
|
292
|
+
|4007|Bash (5.0.11)|
|
293
|
+
|4008|bc (1.07.1)|
|
294
|
+
|4009|Awk (GNU Awk 4.1.4)|
|
295
|
+
|4010|C# (.NET Core 3.1.201)|
|
296
|
+
|4011|C# (Mono-mcs 6.8.0.105)|
|
297
|
+
|4012|C# (Mono-csc 3.5.0)|
|
298
|
+
|4013|Clojure (1.10.1.536)|
|
299
|
+
|4014|Crystal (0.33.0)|
|
300
|
+
|4015|D (DMD 2.091.0)|
|
301
|
+
|4016|D (GDC 9.2.1)|
|
302
|
+
|4017|D (LDC 1.20.1)|
|
303
|
+
|4018|Dart (2.7.2)|
|
304
|
+
|4019|dc (1.4.1)|
|
305
|
+
|4020|Erlang (22.3)|
|
306
|
+
|4021|Elixir (1.10.2)|
|
307
|
+
|4022|F# (.NET Core 3.1.201)|
|
308
|
+
|4023|F# (Mono 10.2.3)|
|
309
|
+
|4024|Forth (gforth 0.7.3)|
|
310
|
+
|4025|Fortran(GNU Fortran 9.2.1)|
|
311
|
+
|4026|Go (1.14.1)|
|
312
|
+
|4027|Haskell (GHC 8.8.3)|
|
313
|
+
|4028|Haxe (4.0.3); js|
|
314
|
+
|4029|Haxe (4.0.3); Java|
|
315
|
+
|4030|JavaScript (Node.js 12.16.1)|
|
316
|
+
|4031|Julia (1.4.0)|
|
317
|
+
|4032|Kotlin (1.3.71)|
|
318
|
+
|4033|Lua (Lua 5.3.5)|
|
319
|
+
|4034|Lua (LuaJIT 2.1.0)|
|
320
|
+
|4035|Dash (0.5.8)|
|
321
|
+
|4036|Nim (1.0.6)|
|
322
|
+
|4037|Objective-C (Clang 10.0.0)|
|
323
|
+
|4038|Common Lisp (SBCL 2.0.3)|
|
324
|
+
|4039|OCaml (4.10.0)|
|
325
|
+
|4040|Octave (5.2.0)|
|
326
|
+
|4041|Pascal (FPC 3.0.4)|
|
327
|
+
|4042|Perl (5.26.1)|
|
328
|
+
|4043|Raku (Rakudo 2020.02.1)|
|
329
|
+
|4044|PHP (7.4.4)|
|
330
|
+
|4045|Prolog (SWI-Prolog 8.0.3)|
|
331
|
+
|4046|PyPy2 (7.3.0)|
|
332
|
+
|4047|PyPy3 (7.3.0)|
|
333
|
+
|4048|Racket (7.6)|
|
334
|
+
|4049|Ruby (2.7.1)|
|
335
|
+
|4050|Rust (1.42.0)|
|
336
|
+
|4051|Scala (2.13.1)|
|
337
|
+
|4052|Java (OpenJDK 1.8.0)|
|
338
|
+
|4053|Scheme (Gauche 0.9.9)|
|
339
|
+
|4054|Standard ML (MLton 20130715)|
|
340
|
+
|4055|Swift (5.2.1)|
|
341
|
+
|4056|Text (cat 8.28)|
|
342
|
+
|4057|TypeScript (3.8)|
|
343
|
+
|4058|Visual Basic (.NET Core 3.1.101)|
|
344
|
+
|4059|Zsh (5.4.2)|
|
345
|
+
|4060|COBOL - Fixed (OpenCOBOL 1.1.0)|
|
346
|
+
|4061|COBOL - Free (OpenCOBOL 1.1.0)|
|
347
|
+
|4062|Brainfuck (bf 20041219)|
|
348
|
+
|4063|Ada2012 (GNAT 9.2.1)|
|
349
|
+
|4064|Unlambda (2.0.0)|
|
350
|
+
|4065|Cython (0.29.16)|
|
351
|
+
|4066|Sed (4.4)|
|
352
|
+
|4067|Vim (8.2.0460)|
|
353
|
+
|
268
354
|
|
269
355
|
### Variables in test_cmd string
|
270
356
|
|
@@ -318,18 +404,18 @@ test_cmd 文字列中の以下の変数には、
|
|
318
404
|
test_cmd: ~
|
319
405
|
```
|
320
406
|
|
321
|
-
- Add .
|
322
|
-
.
|
407
|
+
- Add .raku(Raku) settings
|
408
|
+
.raku(Raku)の設定を追加
|
323
409
|
```YAML
|
324
410
|
ext_settings:
|
325
|
-
'
|
326
|
-
submit_lang: '
|
411
|
+
'raku':
|
412
|
+
submit_lang: '4043' # Raku
|
327
413
|
```
|
328
414
|
|
329
|
-
- Change submission language of .cxx to C++
|
330
|
-
.cxxの提出言語をC++
|
415
|
+
- Change submission language of .cxx to C++(Clang)
|
416
|
+
.cxxの提出言語をC++(Clang)に変更
|
331
417
|
```YAML
|
332
418
|
ext_settings:
|
333
419
|
'cxx':
|
334
|
-
submit_lang: '
|
420
|
+
submit_lang: '4004' # C++(Clang)
|
335
421
|
```
|
data/lib/at_coder_friends.rb
CHANGED
@@ -4,6 +4,7 @@ require 'at_coder_friends/version'
|
|
4
4
|
require 'at_coder_friends/errors'
|
5
5
|
require 'at_coder_friends/path_util'
|
6
6
|
require 'at_coder_friends/config_loader'
|
7
|
+
require 'at_coder_friends/path_info'
|
7
8
|
require 'at_coder_friends/verifier'
|
8
9
|
require 'at_coder_friends/test_runner/base'
|
9
10
|
require 'at_coder_friends/test_runner/sample'
|
data/lib/at_coder_friends/cli.rb
CHANGED
@@ -117,6 +117,7 @@ module AtCoderFriends
|
|
117
117
|
|
118
118
|
ctx.scraping_agent.submit
|
119
119
|
vf.unverify
|
120
|
+
open_submission_list
|
120
121
|
end
|
121
122
|
|
122
123
|
def check_and_go
|
@@ -125,6 +126,7 @@ module AtCoderFriends
|
|
125
126
|
# submit automatically
|
126
127
|
ctx.scraping_agent.submit
|
127
128
|
vf.unverify
|
129
|
+
open_submission_list
|
128
130
|
else
|
129
131
|
# enable manual submit
|
130
132
|
vf.verify
|
@@ -142,5 +144,11 @@ module AtCoderFriends
|
|
142
144
|
def open_contest
|
143
145
|
Launchy.open(ctx.scraping_agent.contest_url)
|
144
146
|
end
|
147
|
+
|
148
|
+
def open_submission_list
|
149
|
+
url = ctx.scraping_agent.contest_url('submissions/me')
|
150
|
+
puts "submission status : #{url}"
|
151
|
+
Launchy.open(url)
|
152
|
+
end
|
145
153
|
end
|
146
154
|
end
|
@@ -11,20 +11,28 @@ module AtCoderFriends
|
|
11
11
|
DEFAULT_FILE = File.join(ACF_HOME, 'config', 'default.yml')
|
12
12
|
|
13
13
|
class << self
|
14
|
+
def dotfile
|
15
|
+
DOTFILE
|
16
|
+
end
|
17
|
+
|
18
|
+
def default_file
|
19
|
+
DEFAULT_FILE
|
20
|
+
end
|
21
|
+
|
14
22
|
def load_config(ctx)
|
15
23
|
path = config_file_for(ctx.path)
|
16
24
|
config = load_yaml(path)
|
17
|
-
return config if path ==
|
25
|
+
return config if path == default_file
|
18
26
|
|
19
27
|
merge_with_default(config)
|
20
28
|
end
|
21
29
|
|
22
30
|
def config_file_for(target_dir)
|
23
|
-
find_project_dotfile(target_dir) ||
|
31
|
+
find_project_dotfile(target_dir) || default_file
|
24
32
|
end
|
25
33
|
|
26
34
|
def find_project_dotfile(target_dir)
|
27
|
-
find_file_upwards(
|
35
|
+
find_file_upwards(dotfile, target_dir)
|
28
36
|
end
|
29
37
|
|
30
38
|
def find_file_upwards(filename, start_dir)
|