This commit introduces a new key, `health-check.whitelisted-chars` for repo.toml. It allows TAs to configure repo-wide allowed non ASCII chars for the repo-health-checker binary. It results in a new command line switch, `-whitelisted-chars=X,Y,Z`, in the generated task.json. Co-Authored-By: GitHub Copilot <noreply@microsoft.com> <details> <summary>Copilot Prompt</summary> <br> This repository contains a Python app that does conversion from TOML config files to a complex, multistage JSON config file for an online judge system. For example, under `tests/convert/full`, input are the two TOML files `repo.toml` and `task.toml`, output is one JSON file `task,json`. Now, I want the repo-specific config (**repo.toml**) to accept an extra dotted key, "health-check.whitelisted-chars". This key shall accept an array of UTF-8 non-ASCII characters. To do so, I want you to - Model. Under `joj3_config_generator/models/repo.py`, add an extra field *whitelisted_chars* to class *HealthCheck*, identified by both "whitelisted-chars" and "whitelisted_chars"; - Transforming. Under `joj3_config_generator/transforers/repo.py`, translate the field to an additional command line switch `-whitelisted-chars`, comma-separated. - Other files you deem necessary, based on your understanding of this repo. IMPORTANT. Before you start, explore this repo to under the file structure and file-function relations. This repo uses the PDM package manager. After you finish your work, test your work appropriately. You should create new testcases under `tests/`. - Details: Read the output `task.json` after running the test, to verify whether the command line switch was added to the *Health Check* `stage` or not. </details> Reviewed-on: https://focs.ji.sjtu.edu.cn/git/JOJ/JOJ3-config-generator/pulls/29 Reviewed-by: 李衍志523370910113 <jon-lee@sjtu.edu.cn> Reviewed-by: 张泊明518370910136 <bomingzh@sjtu.edu.cn> Co-authored-by: Mack Wang <mac-wang@outlook.com> Co-committed-by: Mack Wang <mac-wang@outlook.com>
58 lines
882 B
Python
58 lines
882 B
Python
import pytest
|
|
from pydantic import ValidationError
|
|
|
|
from tests.convert.utils import load_case
|
|
|
|
|
|
def test_basic() -> None:
|
|
load_case("basic")
|
|
|
|
|
|
def test_clang_tidy() -> None:
|
|
load_case("clang-tidy")
|
|
|
|
|
|
def test_cppcheck() -> None:
|
|
load_case("cppcheck")
|
|
|
|
|
|
def test_cpplint() -> None:
|
|
load_case("cpplint")
|
|
|
|
|
|
def test_diff() -> None:
|
|
load_case("diff")
|
|
|
|
|
|
def test_elf() -> None:
|
|
load_case("elf")
|
|
|
|
|
|
def test_empty() -> None:
|
|
load_case("empty")
|
|
|
|
|
|
def test_extra_field() -> None:
|
|
with pytest.raises(ValidationError):
|
|
load_case("extra-field")
|
|
|
|
|
|
def test_full() -> None:
|
|
load_case("full")
|
|
|
|
|
|
def test_keyword() -> None:
|
|
load_case("keyword")
|
|
|
|
|
|
def test_result_detail() -> None:
|
|
load_case("result-detail")
|
|
|
|
|
|
def test_unnecessary() -> None:
|
|
load_case("unnecessary")
|
|
|
|
|
|
def test_whitelisted_chars() -> None:
|
|
load_case("whitelisted-chars")
|