@@ -199,6 +199,7 @@ optional arguments:
199
199
200
200
## 設定ファイルの例
201
201
` ~/.atcodertools.toml ` に以下の設定を保存すると、コードスタイルや、コード生成後に実行するコマンドを指定できます。
202
+ 設定ファイルはcodestyle, postprocess, tester, submit, etcのテーブルに分かれていて、codestyle.nimというようにテーブル名の後に.[ 言語名] で指定するとその言語のみに適用されます。
202
203
203
204
以下は、次の挙動を期待する場合の` ~/.atcodertools.toml ` の例です。
204
205
@@ -224,6 +225,7 @@ optional arguments:
224
225
- ` in_example_format="in_{}.txt" ` テストケース(input)のフォーマットを` in_1.txt, in_2.txt, ... ` とする
225
226
- ` out_example_format="out_{}.txt" ` テストケース(output)のフォーマットを` out_1.txt, out_2.txt, ... ` とする
226
227
228
+
227
229
``` toml
228
230
[codestyle ]
229
231
indent_type =' space' # 'tab' or 'space'
@@ -248,9 +250,23 @@ save_no_session_cache=false
248
250
skip_existing_problems =false
249
251
in_example_format =" in_{}.txt"
250
252
out_example_format =" out_{}.txt"
253
+ ```
254
+
255
+ また、以下のように提出時にコマンドを実行してその結果を提出することが可能です。C++以外のAC-libraryを自動に展開するような用途で用いることができます。下記の例はNim言語でACLのexpanderを実行しその出力ファイルを提出し、その後ローカルの出力ファイルを削除するという設定です。
256
+ なお、C++に関してはAC-libraryがatcoderのジャッジにも搭載されているためこのような設定は不要です。
251
257
258
+ - ` exec_before_submit ` 提出前に実行するコマンド
259
+ - ` submit_filename ` exec_before_submitを実行した結果提出するファイルが変わる場合に指定
260
+ - ` exec_after_submit ` 提出後に行う処理
261
+
262
+ ``` toml
263
+ [submit .nim ]
264
+ exec_before_submit =' rm ./combined.nim | python3 ~/git/Nim-ACL/expander.py main.nim --lib /home/chaemon/git/Nim-ACL/ -s'
265
+ exec_after_submit =' rm ./combined.nim'
266
+ submit_filename =' ./combined.nim'
252
267
```
253
268
269
+
254
270
### カスタムコードジェネレーター
255
271
[ 標準のC++コードジェネレーター] ( https://github.com/kyuridenamida/atcoder-tools/blob/master/atcodertools/codegen/code_generators/cpp.py ) に倣って、
256
272
` (CogeGenArgs) -> str(ソースコード) ` が型であるような` main ` 関数を定義した.pyファイルを` code_generator_file ` で指定すると、コード生成時にカスタムコードジェネレーターを利用できます。
0 commit comments