From 0656dd5c4297a3f842de103df6da8c161667c2b9 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 14 Sep 2025 10:28:57 +0800 Subject: [PATCH] fix: typo + new commit format --- Introduction-to-JOJ3.md | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/Introduction-to-JOJ3.md b/Introduction-to-JOJ3.md index 32c74ab..b496686 100644 --- a/Introduction-to-JOJ3.md +++ b/Introduction-to-JOJ3.md @@ -5,7 +5,7 @@ JOJ3 is the latest version of [JOJ Online Judge](https://focs.ji.sjtu.edu.cn/git ## Simplified JOJ3 structure JOJ3 takes advantage of the latest technologies in order to secure and simplify your workflow. It is composed of three main layers: -- Heath-check: ensures your repository is healthy, eg. commit messages follow common industry standards, no unexpected files are pushed, etc. +- Heath-check: ensures your repository is healthy, eg. commit messages follow common industry standards, no unexpected files are pushed - Runners and online judge: test the quality and correctness of the submitted work - Teapot: format all the feedback and post an issue in your repository @@ -17,7 +17,7 @@ On every single push, heath-check is run, while other layers are activated based All commit messages are expected to comply with [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specifications. JOJ3 parses your commit message and based on its content will trigger different sets of actions. Any commit must be in the format ``` -type(scope): message +type(scope): message [footer] ``` #### Conventional commits format cheat-sheet @@ -29,25 +29,28 @@ The `type` must be one of - `refactor`: changes to the code which neither add a feature nor fix a bug - `perf`: a commit which helps improve performance - `test`: adding or correcting tests -- `build`: changes affecting the build system, eg. Makefile, dependencies +- `build`: changes affecting the build system, eg. `Makefile`, dependencies - `ci`: commit related to Continuous Integration (CI), eg. Gitea actions configuration - `chores`: changes not modifying source code or test cases - `revert`: revert a previous commit -The `scope` is defined and provided by TT for each task or each assignment. For instance, it could be `hw2/ex4` for homework 2 exercise 4 or `p1/m3` for project 1 milestone 3. If you are unsure of the scope of a task reaching to TT. +The `scope` is defined and provided by TT for each task or each assignment. For instance, it could be `hw2/ex4` for homework 2 exercise 4 or `p1/m3` for project 1 milestone 3. If you are unsure of the scope of a task, reach out to TT. -The `message` should concisely describe the changes included in this commit. If `message` contains the keyword `joj` then your work will be tested for correctness through the online judge layer of JOJ3. +The `message` should concisely describe the changes included in this commit. + +The `footer` is used to specify what "steps" should be run, eg. `joj` to test the correctness or `build` to only compile. Footers can vary between courses and assignments, please refer to information provided by TT to know which ones are available. #### Examples Valid commit messages: ```bash -git commit -m"feat(h1/e2): skeleton" # no online-judge -git commit -m"fix(h1/e2): allocate memory before using it" # no online-judge -git commit -m"feat(h1e2): joj task completed" # run online-judge -git commit -m"fix(h1/e2): joj fix for test-case 3" # run online-judge -git commit -m"test(h1/e2): joj ensure all test-cases passed" # run online-judge -git commit -m"docs(h1): student ids added" # no online-judge +git commit -m"feat(h1/ex2): skeleton" # no online-judge +git commit -m"fix(h1/ex2): allocate memory before using it" # no online-judge +git commit -m"feat(h1ex2): task completed [joj]" # run online-judge +git commit -m"fix(h1/ex2): test-case 3 [joj]" # run online-judge +git commit -m"test(h1/ex2): ensure all test-cases passed [joj]" # run online-judge +git commit -m"docs(h1): student ID added" # no online-judge +git commit -m"feat(h4/ex3): card display completed [build]" # only compile, no online-judge ``` Invalid commit message: @@ -68,7 +71,7 @@ git push ### Results -Once you have pushed your work connect to Gitea and check the issue tab for all the feedback on your submission. +Once you have pushed your work, connect to Gitea and check the issue tab for all the feedback on your submission. ## More advanced usage @@ -86,14 +89,14 @@ JOJ3 doesn't change the way to handle (open, create, review, and approve) Pull R Add the following to your `.bashrc` ```bash -jojsubmit() { scope=$1; shift; git commit --allow-empty -m"test($scope): joj $@" && git push; } +jojsubmit() { scope=$1; shift; git commit --allow-empty -m"test($scope): $@ [joj]" && git push; } alias joj-submit=jojsubmit ``` -Then submit to joj using +Then submit to JOJ using ```bash -joj-submit h2/e5 # creates and pushes commit test(h2/5): joj -joj-submit h2/e5 more tests # creates and pushes commit test(h2/e5): joj more tests +joj-submit h2/ex5 # creates and pushes commit test(h2/x5): [joj] +joj-submit h2/ex5 more tests # creates and pushes commit test(h2/e5): more tests [joj] ``` ## Contributing @@ -102,7 +105,7 @@ JOJ3 is still in heavy development and needs your help! You can contribute in tw - Provide feedback on your experience using JOJ3 and help improve it: contact your TT who will get in touch with JOJ3 developers - Join JOJ3 development team: contact Manuel or Boming on Mattermost -The core part of JOJ3 is written in Go while Joint-Teapot part is coded in Python. While the software in itself is very advanced, its architecture is not only very simple, making JOJ3 easily accessible even to motivated freshmen, but also very flexible thereby allowing modular development. The most important requirements to join the development teams are a strong motivation to learn more, the ability to work as part of an international team of developers, as well as the ability to accept and follow directions. +The core part of JOJ3 is written in Go while Joint-Teapot part is coded in Python. While the software in itself is very advanced, its architecture is not only very simple, making JOJ3 easily accessible even to motivated freshmen, but also very flexible thereby allowing modular development. The most important requirements to join the development teams are a strong motivation to learn more, the ability to work as part of an international team of developers, as well as the ability to accept and follow directions.