Skip to content

Commit 636aa9b

Browse files
Release 1.1.5 (kyuridenamida#152)
* Get ready for 1.1.5 * Refactor & Update README.md * Update contributors table * Fix webapp
1 parent 30793e6 commit 636aa9b

File tree

7 files changed

+84
-31
lines changed

7 files changed

+84
-31
lines changed

CHANGELOG.md

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

3+
## 1.1.5 / 2019-08-20
4+
5+
- [#140](https://github.com/kyuridenamida/atcoder-tools/pull/140) Make example input / output names configurable from EtcConfig
6+
- Thanks for [@kitagawa-hr](https://github.com/kitagawa-hr/)'s contribution!
7+
- [#146](https://github.com/kyuridenamida/atcoder-tools/pull/146) Support NIM
8+
- Thanks for [@chaemon](https://github.com/chaemon/)'s contribution!
9+
- [#145](https://github.com/kyuridenamida/atcoder-tools/pull/145) Support DLang
10+
- Thanks for [@penpenpng](https://github.com/penpenpng/)'s contribution!
11+
- [#148](https://github.com/kyuridenamida/atcoder-tools/pull/148) Fix "codegen" error on Windows
12+
- Thanks for [@penpenpng](https://github.com/penpenpng/)'s contribution!
13+
- [#144](https://github.com/kyuridenamida/atcoder-tools/pull/144) Fix Python code generator to generate codes following PEP8
14+
- Thanks for [@penpenpng](https://github.com/penpenpng/)'s contribution!
15+
- [#142](https://github.com/kyuridenamida/atcoder-tools/pull/142) Stop using root logger
16+
- Thanks for [@kmyk](https://github.com/kmyk/)'s contribution!
17+
- [#150](https://github.com/kyuridenamida/atcoder-tools/pull/150) Fix a bug flake8 in .travis.yml doesn't work
18+
- Thanks for [@kmyk](https://github.com/kmyk/)'s contribution!
19+
320
## 1.1.4 / 2019-04-11
421
- [#138](https://github.com/kyuridenamida/atcoder-tools/pull/138) Fix a bug that generated main.py is not executable by making source files executable when their codes have shebang
522
- Thanks for [@kmyk](https://github.com/kmyk/)'s contribution!

README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ Python 3.5 以降で動作する [AtCoder](http://atcoder.jp/) からサンプ
1616
- 他言語対応のためのコントリビューション(≒中間形式からコードに変換する部分のPR)を募集中です!
1717

1818
|対応言語 |Contributor 1|Contributor 2|
19-
|:---:|:---:|:---:|
19+
|---:|:---:|:---:|
2020
|C++|[@kyuridenamida](https://github.com/kyuridenamida/) (generator, template)|[@asi1024](https://github.com/asi1024/) (template)|
2121
|Java|[@kyuridenamida](https://github.com/kyuridenamida/) (generator, template)||
2222
|Rust|[@fukatani](https://github.com/fukatani/) (generator, template)|[@koba-e964](https://github.com/koba-e964/) (template, CR)|
23-
|Python3|[@kmyk](https://github.com/kmyk/) (generator, template)||
23+
|Python3|[@kmyk](https://github.com/kmyk/) (generator, template)|[@penpenpng](https://github.com/penpenpng/) (generator)|
24+
|D|[@penpenpng](https://github.com/penpenpng/) (generator, template)||
25+
|Nim|[@chaemon](https://github.com/chaemon/) (generator, template)||
2426

2527
## Demo
2628
<img src="https://user-images.githubusercontent.com/233559/52807100-f6e2d300-30cd-11e9-8906-82b9f9b2dff7.gif" width=70%>
@@ -59,10 +61,10 @@ https://kyuridenamida.github.io/atcoder-tools/
5961

6062
例:
6163
```console
62-
$ atcoder-tools gen agc001
63-
$ cd ~/atcoder-workspace/agc001/A
64-
$ g++ main.cpp
65-
$ atcoder-tools test
64+
atcoder-tools gen agc001
65+
cd ~/atcoder-workspace/agc001/A
66+
g++ main.cpp
67+
atcoder-tools test
6668
```
6769

6870
`--without-login` 引数を指定するとログインなしでデータをダウンロードできます(一般公開されているコンテストのみ)。
@@ -88,14 +90,15 @@ optional arguments:
8890
--workspace WORKSPACE
8991
Path to workspace's root directory. This script will create files in {WORKSPACE}/{contest_name}/{alphabet}/ e.g. ./your-workspace/arc001/A/
9092
[Default] /home/kyuridenamida/atcoder-workspace
91-
--lang LANG Programming language of your template code, cpp or java.
93+
--lang LANG Programming language of your template code, cpp or java or rust or python or nim or d.
9294
[Default] cpp
9395
--template TEMPLATE File path to your template code
9496
[Default (C++)] /atcodertools/tools/templates/default_template.cpp
9597
[Default (Java)] /atcodertools/tools/templates/default_template.java
9698
[Default (Rust)] /atcodertools/tools/templates/default_template.rs
9799
[Default (Python3)] /atcodertools/tools/templates/default_template.py
98-
100+
[Default (NIM)] /atcodertools/tools/templates/default_template.nim
101+
[Default (D)] /atcodertools/tools/templates/default_template.d
99102
--parallel Prepare problem directories asynchronously using multi processors.
100103
--save-no-session-cache
101104
Save no session cache to avoid security risk
@@ -184,25 +187,27 @@ optional arguments:
184187

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

187-
- コードスタイルの設定が幅4のスペースインデントである
188-
- コード生成テンプレートとして`~/my_template.cpp`を使う
189-
- ワークスペースのルートは `~/atcoder-workspace/`
190-
- 言語設定は `cpp` (提出時もしくはデフォルトのコードジェネレーター生成時に使われます)
191-
- 問題用ディレクトリ内で毎回`clang-format`を実行して、最後に`CMakeLists.txt`(空)をコンテスト用ディレクトリに生成する
192-
- カスタムコードジェネレーター `custom_code_generator.py`を指定する
193-
- AtCoderにログインせずにダウンロードを行う機能を使わない (公開コンテストに対してのみ可能)
194-
- データの並列ダウンロードを無効にする
195-
- ログイン情報のクッキーを保存する
196-
- テストケース(input)のフォーマットを`in_1.txt, in_2.txt, ...`とする
197-
- テストケース(output)のフォーマットを`out_1.txt, out_2.txt, ...`とする
190+
- `indent_type='space'` スペースがインデントに使われる(`'tab'`を指定した場合はタブが使われる)
191+
- `indent_width=4` インデント幅は4である (`indent_width`が無指定の場合`4`(nim言語以外), `2`(nim言語)が規定値として使われます。)
192+
- `template_file='~/my_template.cpp'` コード生成テンプレートとして`~/my_template.cpp`を使う
193+
- `workspace_dir='~/atcoder-workspace/'` ワークスペースのルートは `~/atcoder-workspace/`
194+
- `lang='cpp'` 言語設定は `cpp` (提出時もしくはデフォルトのコードジェネレーター生成時に使われます)
195+
- `code_generator_file="~/custom_code_generator.py"` カスタムコードジェネレーター `~/custom_code_generator.py`を指定する
196+
- `exec_on_each_problem_dir='clang-format -i ./*.cpp'` `exec_on_contest_dir='touch CMakeLists.txt'`
197+
- 問題用ディレクトリ内で毎回`clang-format`を実行して、最後に`CMakeLists.txt`(空)をコンテスト用ディレクトリに生成する
198+
- `download_without_login=false` AtCoderにログインせずにダウンロードを行う機能を使わない (公開コンテストに対してのみ可能)
199+
- `parallel_download=false` データの並列ダウンロードを無効にする
200+
- `save_no_session_cache=false` ログイン情報のクッキーを保存する
201+
- `in_example_format="in_{}.txt"` テストケース(input)のフォーマットを`in_1.txt, in_2.txt, ...`とする
202+
- `out_example_format="out_{}.txt"` テストケース(output)のフォーマットを`out_1.txt, out_2.txt, ...`とする
198203

199204
```toml
200205
[codestyle]
201206
indent_type='space' # 'tab' or 'space'
202207
indent_width=4
203208
template_file='~/my_template.cpp'
204209
workspace_dir='~/atcoder-workspace/'
205-
lang='cpp' # 'cpp' or 'java' (Currently)
210+
lang='cpp' # Check README.md for the supported languages.
206211
code_generator_file="~/custom_code_generator.py"
207212
[postprocess]
208213
exec_on_each_problem_dir='clang-format -i ./*.cpp'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.4"
1+
__version__ = "1.1.5"

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def _requires_from_file(filename):
2424
url='https://github.com/kyuridenamida/atcoder-tools',
2525
author='kyuridenamida',
2626
author_email='tyotyo3@gmail.com',
27+
long_description_content_type="text/markdown",
2728
long_description=readme,
2829
packages=find_packages(exclude=('tests',)),
2930
install_requires=_requires_from_file('requirements.txt'),

webapp/data_builder/build_full_data.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from atcodertools.client.models.problem_content import InputFormatDetectionError, SampleDetectionError, ProblemContent
1313
from atcodertools.codegen.code_style_config import CodeStyleConfig
1414
from atcodertools.codegen.models.code_gen_args import CodeGenArgs
15-
from atcodertools.common.language import RUST, CPP, JAVA, PYTHON
15+
from atcodertools.common.language import RUST, CPP, JAVA, PYTHON, DLANG, NIM
1616
from atcodertools.constprediction.constants_prediction import predict_modulo, predict_yes_no
1717
from atcodertools.constprediction.models.problem_constant_set import ProblemConstantSet
1818
from atcodertools.fileutils.load_text_file import load_text_file
@@ -168,6 +168,8 @@ def do_predict_constants(result: QualityResult):
168168
JAVA_TEMPLATE = load_text_file(JAVA.default_template_path)
169169
RUST_TEMPLATE = load_text_file(RUST.default_template_path)
170170
PYTHON_TEMPLATE = load_text_file(PYTHON.default_template_path)
171+
D_TEMPLATE = load_text_file(DLANG.default_template_path)
172+
NIM_TEMPLATE = load_text_file(NIM.default_template_path)
171173

172174

173175
def generate_code(result: QualityResult):
@@ -200,6 +202,18 @@ def generate_code(result: QualityResult):
200202
result.constant_set,
201203
CodeStyleConfig()
202204
))
205+
result.codes["d"] = DLANG.default_code_generator(CodeGenArgs(
206+
D_TEMPLATE,
207+
result_format,
208+
result.constant_set,
209+
CodeStyleConfig()
210+
))
211+
result.codes["nim"] = NIM.default_code_generator(CodeGenArgs(
212+
NIM_TEMPLATE,
213+
result_format,
214+
result.constant_set,
215+
CodeStyleConfig()
216+
))
203217

204218

205219
_counter = 0

webapp/package-lock.json

Lines changed: 21 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webapp/src/models/Language.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11

2-
type Language = 'cpp' | 'rust' | 'java' | 'python';
3-
export const ALL_LANGUAGES : Language[] = ['cpp', 'rust', 'java', 'python'];
2+
type Language = 'cpp' | 'rust' | 'java' | 'python' | 'd' | 'nim';
3+
export const ALL_LANGUAGES : Language[] = ['cpp', 'rust', 'java', 'python', 'd', 'nim'];
44

55
export const langToDisplayName = (language: Language) => {
66
switch (language){
77
case 'cpp': return 'C++';
88
case 'java': return 'Java';
99
case 'rust': return 'Rust';
1010
case 'python': return 'Python 3';
11+
case 'd': return 'D';
12+
case 'nim': return 'Nim';
1113
}
1214
throw Error(`no display name for ${language}`);
1315
};

0 commit comments

Comments
 (0)