Skip to content

Commit 3494ab6

Browse files
Release/1.0.6 (kyuridenamida#75)
* bug fix about color reset + version change * Update changelog * Update readme
1 parent 19c4613 commit 3494ab6

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## 1.0.6 / 2018-01-13
4+
- [#68](https://github.com/kyuridenamida/atcoder-tools/pull/68) Support custom code generator specification.
5+
- [#69](https://github.com/kyuridenamida/atcoder-tools/pull/69) Support template file specification in toml.
6+
- [#65](https://github.com/kyuridenamida/atcoder-tools/pull/65) Ignore exception while checking version.
7+
- [#64](https://github.com/kyuridenamida/atcoder-tools/pull/64) Increase recall of input format prediction, supporting tex formula.
8+
- [#71](https://github.com/kyuridenamida/atcoder-tools/pull/71) Minor speeding up of prediction.
9+
- [#73](https://github.com/kyuridenamida/atcoder-tools/pull/73) Colorful messages in gen / tester / submit.
10+
- Fix a bug that the color never goes back when you get a message saying "the latest version is available".
11+
12+
313
## 1.0.5 / 2018-01-06
414
- [#59](https://github.com/kyuridenamida/atcoder-tools/pull/59) Support user-defined postprocessor commands after code generation.
515
- [#54](https://github.com/kyuridenamida/atcoder-tools/pull/54) Support constants (MOD/YES/NO) prediction so you can use them in your template.

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,28 @@ optional arguments:
137137
## 設定ファイルの例
138138
`~/.atcodertools.toml`に以下の設定を保存すると、コードスタイルや、コード生成後に実行するコマンドを指定できます。
139139

140-
以下は、コードスタイルの設定が幅4のスペースインデントで、
141-
問題用ディレクトリ内で毎回`clang-format`を実行して、最後に`CMakeLists.txt`(空)をコンテスト用ディレクトリに生成する場合の`~/.atcodertools.toml`の例です。
140+
以下は、次の挙動を期待する場合の`~/.atcodertools.toml`の例です。
141+
142+
- コードスタイルの設定が幅4のスペースインデントである
143+
- コード生成テンプレートとして`~/my_template.cpp`を使う
144+
- 問題用ディレクトリ内で毎回`clang-format`を実行して、最後に`CMakeLists.txt`(空)をコンテスト用ディレクトリに生成する
145+
- カスタムコードジェネレーター `custom_code_generator.py`を指定す
142146

143147
```$xslt
144148
[codestyle]
145149
indent_type = 'space' # 'tab' or 'space'
146150
indent_width = 4
147-
151+
template_file='~/my_template.cpp'
148152
[postprocess]
149153
exec_on_each_problem_dir='clang-format -i ./*.cpp'
150154
exec_on_contest_dir='touch CMakeLists.txt'
155+
code_generator_file="~/custom_code_generator.py"
151156
```
152157

158+
### カスタムコードジェネレーター
159+
[標準のC++コードジェネレーター](https://github.com/kyuridenamida/atcoder-tools/blob/master/atcodertools/codegen/code_generators/cpp.py)に倣って、
160+
`(CogeGenArgs) -> str(ソースコード)`が型であるような`main`関数を定義した.pyファイルを`code_generator_file`で指定すると、コード生成時にカスタムコードジェネレーターを利用できます。
161+
153162
## テンプレートの例
154163
`atcoder-tools gen`コマンドに対し`--template`, `--replacement` でそれぞれ入力形式の推論に成功したときのテンプレート、生成に失敗したときに代わりに生成するソースコードを指定できます。テンプレートエンジンの仕様については[jinja2](http://jinja.pocoo.org/docs/2.10/) の公式ドキュメントを参照してください。テンプレートに渡される変数は以下の通りです。
155164

atcoder-tools

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def notify_if_latest_version_found():
2323
print("To upgrade, run the following command:")
2424
print("")
2525
print("pip3 install atcoder-tools --upgrade")
26+
print(Style.RESET_ALL)
2627
except VersionCheckError:
2728
print(Fore.RED, end='')
2829
print("Failed to fetch the latest version information "
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.5"
1+
__version__ = "1.0.6"

0 commit comments

Comments
 (0)