Skip to content

Commit 1a0acfb

Browse files
authored
READMEのexec on submitの部分を加筆 (kyuridenamida#247)
* READMEのexec on submitの部分を加筆
1 parent 62ca6f8 commit 1a0acfb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ optional arguments:
199199

200200
## 設定ファイルの例
201201
`~/.atcodertools.toml`に以下の設定を保存すると、コードスタイルや、コード生成後に実行するコマンドを指定できます。
202+
設定ファイルはcodestyle, postprocess, tester, submit, etcのテーブルに分かれていて、codestyle.nimというようにテーブル名の後に.[言語名]で指定するとその言語のみに適用されます。
202203

203204
以下は、次の挙動を期待する場合の`~/.atcodertools.toml`の例です。
204205

@@ -224,6 +225,7 @@ optional arguments:
224225
- `in_example_format="in_{}.txt"` テストケース(input)のフォーマットを`in_1.txt, in_2.txt, ...`とする
225226
- `out_example_format="out_{}.txt"` テストケース(output)のフォーマットを`out_1.txt, out_2.txt, ...`とする
226227

228+
227229
```toml
228230
[codestyle]
229231
indent_type='space' # 'tab' or 'space'
@@ -248,9 +250,23 @@ save_no_session_cache=false
248250
skip_existing_problems=false
249251
in_example_format="in_{}.txt"
250252
out_example_format="out_{}.txt"
253+
```
254+
255+
また、以下のように提出時にコマンドを実行してその結果を提出することが可能です。C++以外のAC-libraryを自動に展開するような用途で用いることができます。下記の例はNim言語でACLのexpanderを実行しその出力ファイルを提出し、その後ローカルの出力ファイルを削除するという設定です。
256+
なお、C++に関してはAC-libraryがatcoderのジャッジにも搭載されているためこのような設定は不要です。
251257

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'
252267
```
253268

269+
254270
### カスタムコードジェネレーター
255271
[標準のC++コードジェネレーター](https://github.com/kyuridenamida/atcoder-tools/blob/master/atcodertools/codegen/code_generators/cpp.py)に倣って、
256272
`(CogeGenArgs) -> str(ソースコード)`が型であるような`main`関数を定義した.pyファイルを`code_generator_file`で指定すると、コード生成時にカスタムコードジェネレーターを利用できます。

0 commit comments

Comments
 (0)