Skip to content

Commit bd55d9e

Browse files
authored
Merge pull request #338 from online-judge-tools/update-contributing-md-and-design-md
Update CONTRIBUTING.md and DESIGN.md
2 parents ec1809d + 0c4a0c1 commit bd55d9e

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,27 @@ Do the following steps:
1717
1. Register your language at `onlinejudge_verify/languages/list.py`
1818
1. Add tests to `tests/` dir if possible
1919
1. Update documents `.verify-helper/docs/static/document.md` (or `.verify-helper/docs/static/document.ja.md`)
20+
21+
22+
## CI to check format
23+
24+
[.github/workflows/format.yml](https://github.com/online-judge-tools/verification-helper/blob/master/.github/workflows/format.yml) defines the format checking.
25+
26+
You can run the format checking with the following commands. You can automatically run this with copying this script into your `.git/hooks/pre-commit`.
27+
28+
``` sh
29+
#!/bin/bash
30+
set -e
31+
32+
mypy onlinejudge_verify onlinejudge_bundle tests setup.py
33+
pylint --disable=all --enable=unused-import onlinejudge_verify onlinejudge_bundle tests setup.py
34+
isort --check-only --diff onlinejudge_verify onlinejudge_bundle tests setup.py
35+
yapf --diff --recursive onlinejudge_verify onlinejudge_bundle tests setup.py
36+
```
37+
38+
You can automatically fix some errors with the following commands.
39+
40+
``` sh
41+
isort onlinejudge_verify onlinejudge_bundle tests setup.py
42+
yapf --in-place --recursive onlinejudge_verify onlinejudge_bundle tests setup.py
43+
```

DESIGN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ link: [DESIGN.md](https://github.com/online-judge-tools/.github/blob/master/DESI
6161
- 言語個別の処理は [models.py](https://github.com/online-judge-tools/verification-helper/blob/master/onlinejudge_verify/languages/models.py) にある `Language` class と `LanguageEnvironment` class の sub-class として実装される。`Language` class と `LanguageEnvironment` class の区別は、ひとつの言語 (例: C++) が複数の環境 (例: G++, Clang, MSVC++ など) と関連付けられることから来る区別である。
6262
- 競技プログラミングの文脈では end-to-end tests や integration tests と unit tests の区別が比較的曖昧である。
6363
通常の文脈では end-to-end tests などは unit tests と比べて「実際と似た環境で動かせる」という利点と「遅い」「不安定」「失敗の原因が分かりにくい」という欠点がある ([参考](https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html))。しかしこれは通常の end-to-end tests が「GUI の操作」「ネットワーク通信」「ファイル書き込み」などの複雑で非純粋な要素を含むからである。競技プログラミングにおいてはそのような要素はないのでテストの結果は常に「安定」しており、またファイルの依存関係が疎であることを利用して最適に差分のみテストをすることで十分に「速い」テストが可能である。このため競技プログラミングにおいては end-to-end tests の欠点とされていた特徴の多くは隠れ、unit tests との差も曖昧となる。
64+
- `oj-bundle` コマンドは `#include "..."` の形の include のみを展開し `#include <...>` の形の include のみを展開する。この仕様は、`#include <...>` が「システムの標準のヘッダ」に使われることが意図されており、また `#include "..."` が「カレントディレクトリなどにある自作のヘッダ」に使われことが意図されている、という事情による。参考として、プリプロセッサの挙動についての説明は <https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html> にある。
65+
- `oj-bundle` コマンドが [online-judge-tools/verification-helper](https://github.com/online-judge-tools/verification-helper) リポジトリにあるのは便宜上のものである。対応言語が増えるようなら他の新しいリポジトリに移されるだろう。
6466

6567

6668
## Security Considerations

0 commit comments

Comments
 (0)