A CLI tool that generates configuration files for JOJ3.
Go to file
王韵晨520370910012 8176ea8c5e
All checks were successful
build / build (push) Successful in 8m39s
build / trigger-build-image (push) Successful in 1m36s
feat: add whitelist character support in repo toml (#29)
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: #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>
2026-04-22 17:06:54 +08:00
.gitea/workflows fix: pdm run test 2025-06-20 17:18:00 -04:00
joj3_config_generator feat: add whitelist character support in repo toml (#29) 2026-04-22 17:06:54 +08:00
tests feat: add whitelist character support in repo toml (#29) 2026-04-22 17:06:54 +08:00
.editorconfig chore: simple .editorconfig 2024-10-03 22:58:24 -04:00
.gitignore chore: add setuptools-scm with version 2025-06-02 20:22:41 -04:00
.pre-commit-config.yaml feat: more strict models 2025-09-17 14:26:09 -07:00
LICENSE chore: cleanup & setup pdm 2024-10-17 18:28:01 -04:00
pdm.lock feat: natural sort cases 2025-11-21 20:12:27 -08:00
pyproject.toml feat: natural sort cases 2025-11-21 20:12:27 -08:00
README.md docs: add force reinstall option 2025-06-01 06:59:58 -04:00

JOJ3-config-generator

Codacy Badge Codacy Badge

Getting Started

For users

  1. Install Python>=3.9 and pip
  2. (Optional) Create a virtual environment, check here.
  3. Install/Upgrade the project by pip install --force-reinstall --upgrade git+ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/JOJ3-config-generator.git
  4. Run it by joj3-config-generator --help

For developers

  1. Clone this repo by git clone ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/JOJ3-config-generator.git
  2. Install Python>=3.9 and PDM
  3. Change dir to the repo, cd JOJ3-config-generator
  4. Install deps by pdm install && pdm run pre-commit install
  5. Run the cli app by pdm run app --help
  6. Check other commands or scripts with pdm run --list

How to use?

  • joj3-config-generator convert function is now supported, currently support one argument as input, it indicates the convert root
    • default value on the server can be given as /home/tt/.config/joj
    • NOTE: the user should ensure that the ideal repo.toml file is in the sub-directory of the convert root
    • the intended immutable files should be placed at a sub-directory named immutable_files at same position as the repo.toml file
$ tree .
.
|- immutable_files
| |-- push.yaml
| |-- release.yaml
|-- repo.toml
  • sample command on the server
joj3-config-generator convert /home/tt/.config/joj