From 23db05207d49dd980a00a2bc95fe262b80cea28c Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sat, 26 Apr 2025 17:59:35 +0100 Subject: [PATCH 01/23] first commit --- .github/workflows/PR-review-bot.yml | 40 +++++++++++++++++++++++++++++ requirements.txt | 2 ++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/PR-review-bot.yml create mode 100644 requirements.txt diff --git a/.github/workflows/PR-review-bot.yml b/.github/workflows/PR-review-bot.yml new file mode 100644 index 0000000..9e7df17 --- /dev/null +++ b/.github/workflows/PR-review-bot.yml @@ -0,0 +1,40 @@ +name: Pull Request Review Bot + +on: + pull_request: + branch: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Download Repo In Docker + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' # fallback if .python-version is missing + + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install pytest + + - name: Run tests and save output + id: test + run: | + pytest | tee result.loge + + - name: Request changes if tests failed + if: failure() # Only runs if the test step fails + run: | + curl -X POST \ + -H "Authorization: token ${{ secrets.GH_BOT_PAT }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \ + -d '{ + "body": "๐Ÿšจ Your pull request failed the tests. Please fix them before we can merge.", + "event": "REQUEST_CHANGES" + }' diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..31ef97d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +numpy +pytest \ No newline at end of file From 358b8bc0c8064e54c7be7f1899fc7e82b9d8bc20 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sat, 26 Apr 2025 18:23:37 +0100 Subject: [PATCH 02/23] example of change --- ignorethisfile.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ignorethisfile.txt diff --git a/ignorethisfile.txt b/ignorethisfile.txt new file mode 100644 index 0000000..e69de29 From af2268627ee914319bcca25c289100f911c8ceae Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sat, 26 Apr 2025 18:52:18 +0100 Subject: [PATCH 03/23] helloWorld --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 31ef97d..1cc18fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ numpy -pytest \ No newline at end of file +pytest From 51494c68eeda85b5fb2468c9a81cf13d0ce1bee8 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sat, 26 Apr 2025 19:14:39 +0100 Subject: [PATCH 04/23] test --- .github/workflows/PR-review-bot.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/PR-review-bot.yml b/.github/workflows/PR-review-bot.yml index 9e7df17..eba13ae 100644 --- a/.github/workflows/PR-review-bot.yml +++ b/.github/workflows/PR-review-bot.yml @@ -24,8 +24,7 @@ jobs: - name: Run tests and save output id: test - run: | - pytest | tee result.loge + run: pytest | tee result.loge - name: Request changes if tests failed if: failure() # Only runs if the test step fails From 61e2353ceb8785b6af3b99f44942094626c34379 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 12:47:50 +0100 Subject: [PATCH 05/23] update tester --- .github/workflows/PR-review-bot.yml | 39 ----------------------------- .github/workflows/code-tester.yml | 25 ++++++++++++++++++ 2 files changed, 25 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/PR-review-bot.yml create mode 100644 .github/workflows/code-tester.yml diff --git a/.github/workflows/PR-review-bot.yml b/.github/workflows/PR-review-bot.yml deleted file mode 100644 index eba13ae..0000000 --- a/.github/workflows/PR-review-bot.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Pull Request Review Bot - -on: - pull_request: - branch: [ master ] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Download Repo In Docker - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' # fallback if .python-version is missing - - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install pytest - - - name: Run tests and save output - id: test - run: pytest | tee result.loge - - - name: Request changes if tests failed - if: failure() # Only runs if the test step fails - run: | - curl -X POST \ - -H "Authorization: token ${{ secrets.GH_BOT_PAT }}" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \ - -d '{ - "body": "๐Ÿšจ Your pull request failed the tests. Please fix them before we can merge.", - "event": "REQUEST_CHANGES" - }' diff --git a/.github/workflows/code-tester.yml b/.github/workflows/code-tester.yml new file mode 100644 index 0000000..58aecb6 --- /dev/null +++ b/.github/workflows/code-tester.yml @@ -0,0 +1,25 @@ +name: Code Tester + +on: + pull_request: + branch: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Download Repo In Docker + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run tests + id: test + run: pytest From ea40cd57318d0c6ba662cfa76698fefbf537ae22 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 14:29:15 +0100 Subject: [PATCH 06/23] update requirement.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 1cc18fc..e885f2f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ numpy +rich pytest From b8d83fccb7334e2b7955a715cf6d479df17604eb Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 14:48:44 +0100 Subject: [PATCH 07/23] test --- ignorethisfile.txt | 0 tests/datastructures/stack/test_stack.py | 3 +++ 2 files changed, 3 insertions(+) delete mode 100644 ignorethisfile.txt diff --git a/ignorethisfile.txt b/ignorethisfile.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/datastructures/stack/test_stack.py b/tests/datastructures/stack/test_stack.py index 6f22ede..18bf80a 100644 --- a/tests/datastructures/stack/test_stack.py +++ b/tests/datastructures/stack/test_stack.py @@ -123,3 +123,6 @@ def test_string_representation() -> None: assert "3" in rep assert "2" in rep assert "1" in rep + + + assert False \ No newline at end of file From ce53978f3d6d00a9ad5169500aedb24b49dfe9e8 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 14:49:55 +0100 Subject: [PATCH 08/23] test --- tests/datastructures/stack/test_stack.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/datastructures/stack/test_stack.py b/tests/datastructures/stack/test_stack.py index 18bf80a..bdb9d81 100644 --- a/tests/datastructures/stack/test_stack.py +++ b/tests/datastructures/stack/test_stack.py @@ -122,7 +122,4 @@ def test_string_representation() -> None: assert "Stack" in rep assert "3" in rep assert "2" in rep - assert "1" in rep - - - assert False \ No newline at end of file + assert "1" in rep \ No newline at end of file From 59797a3655f59e5f428fe0eac9d5c3120e600043 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 15:26:04 +0100 Subject: [PATCH 09/23] clean file structure --- .github/workflows/auto-fill-algo-name.yaml | 39 ------------------- ...ill-bug-title.yaml => issue-renaming.yaml} | 34 ++++++++++++++-- 2 files changed, 31 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/auto-fill-algo-name.yaml rename .github/workflows/{auto-fill-bug-title.yaml => issue-renaming.yaml} (61%) diff --git a/.github/workflows/auto-fill-algo-name.yaml b/.github/workflows/auto-fill-algo-name.yaml deleted file mode 100644 index 1d2614f..0000000 --- a/.github/workflows/auto-fill-algo-name.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: Auto-fill Algorithm Title - -on: - issues: - types: [opened] - -permissions: - issues: write - -jobs: - update-issue-title: - runs-on: ubuntu-latest - steps: - - name: Parse markdown and update title - uses: actions/github-script@v7 - with: - script: | - const issueBody = context.payload.issue.body; - console.log("Issue Body:\n", issueBody); - - // Match the content under the "### Algo_Name" section - const match = /### Algo_Name\s*\n+(.+?)(\n+###|\n*$)/s.exec(issueBody); - if (!match) { - console.log("๐Ÿšซ Could not find algo name in Markdown."); - return; - } - - const algoName = match[1].trim(); - const issueNumber = context.issue.number; - const newTitle = `โœจ Implement ${algoName}`; - - console.log(`โœ… Extracted algo name: ${algoName}`); - console.log(`๐Ÿ”ง Updating issue title to: ${newTitle}`); - - await github.rest.issues.update({ - ...context.repo, - issue_number: issueNumber, - title: newTitle - }); diff --git a/.github/workflows/auto-fill-bug-title.yaml b/.github/workflows/issue-renaming.yaml similarity index 61% rename from .github/workflows/auto-fill-bug-title.yaml rename to .github/workflows/issue-renaming.yaml index 04c8b48..ee1ba45 100644 --- a/.github/workflows/auto-fill-bug-title.yaml +++ b/.github/workflows/issue-renaming.yaml @@ -8,7 +8,37 @@ permissions: issues: write jobs: - update-issue-title: + rename-new-algo-issue: + runs-on: ubuntu-latest + steps: + - name: Parse markdown and update title + uses: actions/github-script@v7 + with: + script: | + const issueBody = context.payload.issue.body; + console.log("Issue Body:\n", issueBody); + + // Match the content under the "### Algo_Name" section + const match = /### Algo_Name\s*\n+(.+?)(\n+###|\n*$)/s.exec(issueBody); + if (!match) { + console.log("๐Ÿšซ Could not find algo name in Markdown."); + return; + } + + const algoName = match[1].trim(); + const issueNumber = context.issue.number; + const newTitle = `โœจ Implement ${algoName}`; + + console.log(`๐Ÿ”ง Updating issue title to: ${newTitle}`); + + await github.rest.issues.update({ + ...context.repo, + issue_number: issueNumber, + title: newTitle + }); + + + rename-bug-report-issues: runs-on: ubuntu-latest steps: - name: Extract severity and bug title from Markdown @@ -44,8 +74,6 @@ jobs: const issueNumber = context.issue.number; const updatedTitle = `${severityIcon} [Bug]: ${rawTitle}`; - console.log(`โœ… Updating title to: ${updatedTitle}`); - await github.rest.issues.update({ ...context.repo, issue_number: issueNumber, From 6efdeab76e29d5fcccc8a3e75167d2ebf17e275a Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 15:33:22 +0100 Subject: [PATCH 10/23] update --- .github/workflows/issue-renaming.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/issue-renaming.yaml b/.github/workflows/issue-renaming.yaml index ee1ba45..0ab3eb0 100644 --- a/.github/workflows/issue-renaming.yaml +++ b/.github/workflows/issue-renaming.yaml @@ -73,6 +73,7 @@ jobs: const issueNumber = context.issue.number; const updatedTitle = `${severityIcon} [Bug]: ${rawTitle}`; + console.log(`๐Ÿ”ง Updating issue title to: ${newTitle}`); await github.rest.issues.update({ ...context.repo, From 031bb0f7d34399f41daeef4b310e47282d221a63 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 15:49:34 +0100 Subject: [PATCH 11/23] using 1 docker file for issue renaming --- ...sue-renaming.yaml => issue-Automatic-renaming.yaml} | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) rename .github/workflows/{issue-renaming.yaml => issue-Automatic-renaming.yaml} (95%) diff --git a/.github/workflows/issue-renaming.yaml b/.github/workflows/issue-Automatic-renaming.yaml similarity index 95% rename from .github/workflows/issue-renaming.yaml rename to .github/workflows/issue-Automatic-renaming.yaml index 0ab3eb0..0a97094 100644 --- a/.github/workflows/issue-renaming.yaml +++ b/.github/workflows/issue-Automatic-renaming.yaml @@ -1,4 +1,4 @@ -name: Auto-fill Bug Title +name: Issue Automatic Renaming on: issues: @@ -8,9 +8,9 @@ permissions: issues: write jobs: - rename-new-algo-issue: + steps: runs-on: ubuntu-latest - steps: + rename-new-algo-issue: - name: Parse markdown and update title uses: actions/github-script@v7 with: @@ -38,9 +38,7 @@ jobs: }); - rename-bug-report-issues: - runs-on: ubuntu-latest - steps: + rename-bug-report-issues: - name: Extract severity and bug title from Markdown uses: actions/github-script@v7 with: From 7cbb52f03b780a0b2af560bba5bee28a80932fa6 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 16:48:25 +0100 Subject: [PATCH 12/23] fix --- .github/workflows/issue-Automatic-renaming.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/issue-Automatic-renaming.yaml b/.github/workflows/issue-Automatic-renaming.yaml index 0a97094..f52822c 100644 --- a/.github/workflows/issue-Automatic-renaming.yaml +++ b/.github/workflows/issue-Automatic-renaming.yaml @@ -37,7 +37,9 @@ jobs: title: newTitle }); - +jobs: + step: + runs-on: ubuntu-latest rename-bug-report-issues: - name: Extract severity and bug title from Markdown uses: actions/github-script@v7 From 4280607aace4318ddc2eff5c2fa0d64ffcc694fb Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 16:52:20 +0100 Subject: [PATCH 13/23] fix --- .../workflows/issue-Automatic-renaming.yaml | 65 +++++++++---------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/.github/workflows/issue-Automatic-renaming.yaml b/.github/workflows/issue-Automatic-renaming.yaml index f52822c..6aa06ba 100644 --- a/.github/workflows/issue-Automatic-renaming.yaml +++ b/.github/workflows/issue-Automatic-renaming.yaml @@ -8,52 +8,47 @@ permissions: issues: write jobs: - steps: + rename-issue: runs-on: ubuntu-latest - rename-new-algo-issue: - - name: Parse markdown and update title - uses: actions/github-script@v7 - with: - script: | - const issueBody = context.payload.issue.body; - console.log("Issue Body:\n", issueBody); + steps: + - name: Rename for New Algo Issues + uses: actions/github-script@v7 + if: contains(github.event.issue.body, '### Algo_Name') + with: + script: | + const issueBody = context.payload.issue.body; + console.log("Issue Body:\n", issueBody); - // Match the content under the "### Algo_Name" section - const match = /### Algo_Name\s*\n+(.+?)(\n+###|\n*$)/s.exec(issueBody); - if (!match) { - console.log("๐Ÿšซ Could not find algo name in Markdown."); - return; - } + const match = /### Algo_Name\s*\n+(.+?)(\n+###|\n*$)/s.exec(issueBody); + if (!match) { + console.log("๐Ÿšซ Could not find algo name in Markdown."); + return; + } - const algoName = match[1].trim(); - const issueNumber = context.issue.number; - const newTitle = `โœจ Implement ${algoName}`; + const algoName = match[1].trim(); + const issueNumber = context.issue.number; + const newTitle = `โœจ Implement ${algoName}`; - console.log(`๐Ÿ”ง Updating issue title to: ${newTitle}`); + console.log(`๐Ÿ”ง Updating issue title to: ${newTitle}`); - await github.rest.issues.update({ - ...context.repo, - issue_number: issueNumber, - title: newTitle - }); - -jobs: - step: - runs-on: ubuntu-latest - rename-bug-report-issues: - - name: Extract severity and bug title from Markdown + await github.rest.issues.update({ + ...context.repo, + issue_number: issueNumber, + title: newTitle + }); + + - name: Rename for Bug Report Issues uses: actions/github-script@v7 + if: contains(github.event.issue.body, '### Severity') with: script: | const body = context.payload.issue.body; console.log("Issue Body:\n", body); - const severityMatch = /### Severity\s+(.+?)\s+(###|$)/s.exec(body); + const severityMatch = /### Severity\s+(.+?)\s*(###|$)/s.exec(body); const severity = severityMatch ? severityMatch[1].trim() : null; - const rawTitle = context.payload.issue.title; - - if (!severityMatch) { + if (!severity) { console.log("๐Ÿšซ Could not find severity in Markdown."); return; } @@ -66,6 +61,7 @@ jobs: }; const severityIcon = severityMap[severity] || "โ“"; + const rawTitle = context.payload.issue.title; if (rawTitle.startsWith("๐Ÿ”ฅ") || rawTitle.startsWith("๐Ÿ›‘") || rawTitle.startsWith("โš ๏ธ") || rawTitle.startsWith("โ“")) { console.log("โœ… Title already formatted correctly."); return; @@ -73,7 +69,8 @@ jobs: const issueNumber = context.issue.number; const updatedTitle = `${severityIcon} [Bug]: ${rawTitle}`; - console.log(`๐Ÿ”ง Updating issue title to: ${newTitle}`); + + console.log(`๐Ÿ”ง Updating issue title to: ${updatedTitle}`); await github.rest.issues.update({ ...context.repo, From 4fd1e16c963cb1c6bd267dfb90b03ed82c34595a Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Sun, 27 Apr 2025 20:12:51 +0100 Subject: [PATCH 14/23] fix --- .github/workflows/code-tester.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/code-tester.yml b/.github/workflows/code-tester.yml index 58aecb6..b519c8b 100644 --- a/.github/workflows/code-tester.yml +++ b/.github/workflows/code-tester.yml @@ -21,5 +21,4 @@ jobs: run: pip install -r requirements.txt - name: Run tests - id: test run: pytest From 2cf10176e0390ae033711f95d7fcb1c8fadc272b Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Mon, 28 Apr 2025 21:16:21 +0100 Subject: [PATCH 15/23] changing issue bug report template --- .github/ISSUE_TEMPLATE/bug_repport.yaml | 11 +- .../workflows/issue-Automatic-renaming.yaml | 12 ++- docs/CONTRIBUTING.md | 100 +++++++++--------- 3 files changed, 66 insertions(+), 57 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_repport.yaml b/.github/ISSUE_TEMPLATE/bug_repport.yaml index 804441c..f5736bf 100644 --- a/.github/ISSUE_TEMPLATE/bug_repport.yaml +++ b/.github/ISSUE_TEMPLATE/bug_repport.yaml @@ -8,10 +8,13 @@ body: attributes: label: Severity options: - - ๐Ÿ”ฅ Blocker - - ๐Ÿ›‘ Major - - โš ๏ธ Minor - - โ“ Not sure + - ๐Ÿงฎ Algorithm Implementation + - ๐Ÿ›  CI/Tooling Issue + - ๐Ÿ“˜ Algorithm Documentation + - ๐Ÿ–‹ General Documentation + - ๐Ÿงช Test Failure or Adding Testcase + - โ“ Other / Not Sure + default: 0 validations: required: true diff --git a/.github/workflows/issue-Automatic-renaming.yaml b/.github/workflows/issue-Automatic-renaming.yaml index 6aa06ba..2a2062a 100644 --- a/.github/workflows/issue-Automatic-renaming.yaml +++ b/.github/workflows/issue-Automatic-renaming.yaml @@ -54,10 +54,12 @@ jobs: } const severityMap = { - "๐Ÿ”ฅ Blocker": "๐Ÿ”ฅ", - "๐Ÿ›‘ Major": "๐Ÿ›‘", - "โš ๏ธ Minor": "โš ๏ธ", - "โ“ Not sure": "โ“" + "๐Ÿงฎ Algorithm Implementation": "๐Ÿงฎ", + "๐Ÿ›  CI/Tooling Issue": "๐Ÿ› ", + "๐Ÿ“˜ Algorithm Documentation": "๐Ÿ“˜", + "๐Ÿ–‹ General Documentation": "๐Ÿ–‹", + "๐Ÿงช Test Failure or Adding Testcase": "๐Ÿงช", + "โ“ Other / Not Sure": "โ“", }; const severityIcon = severityMap[severity] || "โ“"; @@ -68,7 +70,7 @@ jobs: } const issueNumber = context.issue.number; - const updatedTitle = `${severityIcon} [Bug]: ${rawTitle}`; + const updatedTitle = `$โš ๏ธ - {severityIcon} [Bug]: ${rawTitle}`; console.log(`๐Ÿ”ง Updating issue title to: ${updatedTitle}`); diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 19526db..8ae10c1 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -6,29 +6,18 @@ We welcome all kinds of contributionsโ€”whether you're fixing bugs, improving do ## โœ… What you can contribute +- Report bug - Add a new algorithm or data structure - Improve or correct existing implementations - Write or update documentation - Add test cases or enhance test coverage -- Fix typos or bugs +- Fix typos -## Guidelines +## How to contribut -- **Coding Standards:** - Follow clean and consistent coding practices. Use meaningful variable and function names. +Every change in the repository should be merged throught [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). All commit execute [Ruff](https://docs.astral.sh/ruff/) to insure the some level of coding standart. -- **Document Your Code:** - Ensure all functions have clear and concise comments/description. - -- **Test Your Changes:** - While we understand that fully testing this library may be challenging, ensure your code works as intended before submitting. Focus on edge cases and confirm that your changes integrate smoothly with existing functionality. - -- **Be Respectful**: - Engage in discussions respectfully and constructively. - -- **Follow The File Structure Templates**: Each Algorithm should have its own file in **scr** with: A README based on the template and the python file. Parallel to that you should create another file inside tests with a python file torun the tests and a YAML file to store the tests cases. - -## Before Contributing +### Before Contributing Before making the first commit of the session, you should set up the **pre-commit** framework and activate the **virtual environment**. This has to be done for each new session. @@ -43,6 +32,52 @@ Before making the first commit of the session, you should set up the **pre-commi pre-commit install ``` +### Implementing a new algorithm + +Before implementing a new algorithm. The Python virtual environment should include [rich](https://pypi.org/project/rich/) and [pytest](https://pypi.org/project/pytest/). In order to do it, run the commend below. + +```bash +pip install -r requirements.txt +``` + +Every algorithm implementation should have a dedicated **issue**. This issue should be build with the **Implement Algorithm** issue form. If no issue exist for the specific algorithm to be implemented create one. Every file inside the new repository and the **test file** should follow the file structure inside [File Structure](#๐Ÿ“-file-structure) section. + +All algorithm should be accompanied with a **README.md** file. This file should follow the template in the [Algorithm README.md](#algorithm-readme) section. + +Every algorithm should be tested using [pytest](https://docs.pytest.org/en/stable/). + +## ๐Ÿ› Bug Report + +To report a bug, simply create a new issue using the **Bug Report** form and fill out all sections. +The form is straightforward, but if youโ€™d like a bit more guidance, follow the steps below. ๐Ÿ‘‡ + +### ๐Ÿ“ Steps to Report a Bug + +1. **Enter a clear, short title** + Use a short, clear title that describes the issue. + + > Example: `Crash when clicking the login button` + +2. **What type of issue is this? (Bug Type)** +- ๐Ÿงฎ Algorithm Implementation - The logic or output of an algorithm is incorrect. +- ๐Ÿ›  CI/Tooling Issue - Problems with continuous integration or scripts. +- ๐Ÿ“˜ Algorithm Documentation - Missing or incorrect explanations/comments for an algorithm. +- ๐Ÿ–‹ General Documentation - Typos, formatting, or missing information not specific to one algorithm. +- ๐Ÿงช Test Failure or Adding Testcase - Broken tests or missing edge case coverage. +- โ“ Other / Not Sure - Youโ€™re unsure how bad it is or some other kind of issue. + +3. **In the Steps to Reproduce & What Happens section:** + +- List step-by-step instructions to trigger the bug +- Describe what actually happens + +4. **Describe what you expected to happen(Expected Behavior):** + In the Expected Behavior section, explain what you thought would happen instead. + +5. **Create the issue:** + Once you create the issue, our system will automatically format the title. + This formatting takes about 4 seconds. + ## ๐Ÿ“ File Structure When adding a new algorithm, follow this structure: @@ -75,7 +110,7 @@ AlgoHub/ ``` -### Algorithm README.md +### Algorithm README The README.md inside the **New_Algorithm** folder should follow the following template. @@ -153,34 +188,3 @@ The README.md inside the **New_Data_Structure** folder should follow the followi - **Search**: ``` - -## ๐Ÿ› Bug Report - -To report a bug, simply create a new issue using the **Bug Report** form and fill out all sections. -The form is straightforward, but if youโ€™d like a bit more guidance, follow the steps below. ๐Ÿ‘‡ - -### ๐Ÿ“ Steps to Report a Bug - -1. **Enter a clear, short title** - Use a short, clear title that describes the issue. - - > Example: `Crash when clicking the login button` - -2. **Choose how serious the issue is (severity):** - -- ๐Ÿ”ฅ Blocker โ€“ Completely breaks core functionality -- ๐Ÿ›‘ Major โ€“ Important features arenโ€™t working -- โš ๏ธ Minor โ€“ Small issues or annoyances -- โ“ Not sure โ€“ Youโ€™re unsure how bad it is - -3. **In the Steps to Reproduce & What Happens section:** - -- List step-by-step instructions to trigger the bug -- Describe what actually happens - -4. **Describe what you expected to happen(Expected Behavior):** - In the Expected Behavior section, explain what you thought would happen instead. - -5. **Create the issue:** - Once you create the issue, our system will automatically format the title. - This formatting takes about 4 seconds. From 922fe9c1d907978780ca41703d6929765cb552e4 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Mon, 28 Apr 2025 21:20:15 +0100 Subject: [PATCH 16/23] fix bug_repport.yaml --- .github/workflows/issue-Automatic-renaming.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-Automatic-renaming.yaml b/.github/workflows/issue-Automatic-renaming.yaml index 2a2062a..cd54ccf 100644 --- a/.github/workflows/issue-Automatic-renaming.yaml +++ b/.github/workflows/issue-Automatic-renaming.yaml @@ -70,7 +70,7 @@ jobs: } const issueNumber = context.issue.number; - const updatedTitle = `$โš ๏ธ - {severityIcon} [Bug]: ${rawTitle}`; + const updatedTitle = `โš ๏ธ - ${severityIcon} [Bug]: ${rawTitle}`; console.log(`๐Ÿ”ง Updating issue title to: ${updatedTitle}`); From a5a339616a652925e6a97153a40e9bb62328fa8b Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Mon, 28 Apr 2025 21:54:02 +0100 Subject: [PATCH 17/23] naming fix --- .github/ISSUE_TEMPLATE/bug_repport.yaml | 4 ++-- .github/workflows/issue-Automatic-renaming.yaml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_repport.yaml b/.github/ISSUE_TEMPLATE/bug_repport.yaml index f5736bf..6d709d3 100644 --- a/.github/ISSUE_TEMPLATE/bug_repport.yaml +++ b/.github/ISSUE_TEMPLATE/bug_repport.yaml @@ -1,12 +1,12 @@ name: Bug Report description: File a bug report. -title: 'Enter a short title that describes the issue' # Placeholder for the user to edit +title: 'Enter a short title that describes the issue' labels: [bug] body: - type: dropdown attributes: - label: Severity + label: Type options: - ๐Ÿงฎ Algorithm Implementation - ๐Ÿ›  CI/Tooling Issue diff --git a/.github/workflows/issue-Automatic-renaming.yaml b/.github/workflows/issue-Automatic-renaming.yaml index cd54ccf..d87bdac 100644 --- a/.github/workflows/issue-Automatic-renaming.yaml +++ b/.github/workflows/issue-Automatic-renaming.yaml @@ -39,21 +39,21 @@ jobs: - name: Rename for Bug Report Issues uses: actions/github-script@v7 - if: contains(github.event.issue.body, '### Severity') + if: contains(github.event.issue.body, '### Type') with: script: | const body = context.payload.issue.body; console.log("Issue Body:\n", body); - const severityMatch = /### Severity\s+(.+?)\s*(###|$)/s.exec(body); - const severity = severityMatch ? severityMatch[1].trim() : null; + const typeMatch = /### Type\s+(.+?)\s*(###|$)/s.exec(body); + const Type = typeMatch ? typeMatch[1].trim() : null; - if (!severity) { - console.log("๐Ÿšซ Could not find severity in Markdown."); + if (!Type) { + console.log("๐Ÿšซ Could not find Type in Markdown."); return; } - const severityMap = { + const typeMap = { "๐Ÿงฎ Algorithm Implementation": "๐Ÿงฎ", "๐Ÿ›  CI/Tooling Issue": "๐Ÿ› ", "๐Ÿ“˜ Algorithm Documentation": "๐Ÿ“˜", @@ -61,7 +61,7 @@ jobs: "๐Ÿงช Test Failure or Adding Testcase": "๐Ÿงช", "โ“ Other / Not Sure": "โ“", }; - const severityIcon = severityMap[severity] || "โ“"; + const typeIcon = typeMap[Type] || "โ“"; const rawTitle = context.payload.issue.title; if (rawTitle.startsWith("๐Ÿ”ฅ") || rawTitle.startsWith("๐Ÿ›‘") || rawTitle.startsWith("โš ๏ธ") || rawTitle.startsWith("โ“")) { @@ -70,7 +70,7 @@ jobs: } const issueNumber = context.issue.number; - const updatedTitle = `โš ๏ธ - ${severityIcon} [Bug]: ${rawTitle}`; + const updatedTitle = `โš ๏ธ - ${typeIcon} [Bug]: ${rawTitle}`; console.log(`๐Ÿ”ง Updating issue title to: ${updatedTitle}`); From 8db52509bd9b2b5d17c12928252e1505d85b5e4e Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Mon, 28 Apr 2025 22:00:13 +0100 Subject: [PATCH 18/23] changing triggers of Issue Automatic Renaming --- .github/workflows/issue-Automatic-renaming.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-Automatic-renaming.yaml b/.github/workflows/issue-Automatic-renaming.yaml index d87bdac..a7ae476 100644 --- a/.github/workflows/issue-Automatic-renaming.yaml +++ b/.github/workflows/issue-Automatic-renaming.yaml @@ -2,7 +2,7 @@ name: Issue Automatic Renaming on: issues: - types: [opened] + types: [opened, edited] permissions: issues: write From faf4a2d7438befe259ea94c4a172db589fe5d889 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Mon, 28 Apr 2025 22:33:26 +0100 Subject: [PATCH 19/23] fix typo inside CONTRIBUTING.md --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 8ae10c1..2ffa561 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -62,7 +62,7 @@ The form is straightforward, but if youโ€™d like a bit more guidance, follow the - ๐Ÿงฎ Algorithm Implementation - The logic or output of an algorithm is incorrect. - ๐Ÿ›  CI/Tooling Issue - Problems with continuous integration or scripts. - ๐Ÿ“˜ Algorithm Documentation - Missing or incorrect explanations/comments for an algorithm. -- ๐Ÿ–‹ General Documentation - Typos, formatting, or missing information not specific to one algorithm. +- ๐Ÿ–‹ General Documentation - Typos, formatting, or missing information inside documentation that is not related to an algorithm. - ๐Ÿงช Test Failure or Adding Testcase - Broken tests or missing edge case coverage. - โ“ Other / Not Sure - Youโ€™re unsure how bad it is or some other kind of issue. From 1d3037cf3ae32841b4417e96bcdbdabfbba6000d Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Wed, 30 Apr 2025 11:45:29 +0100 Subject: [PATCH 20/23] small improvements in code-tester.yaml --- .github/workflows/{code-tester.yml => code-tester.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{code-tester.yml => code-tester.yaml} (91%) diff --git a/.github/workflows/code-tester.yml b/.github/workflows/code-tester.yaml similarity index 91% rename from .github/workflows/code-tester.yml rename to .github/workflows/code-tester.yaml index b519c8b..cd741c9 100644 --- a/.github/workflows/code-tester.yml +++ b/.github/workflows/code-tester.yaml @@ -21,4 +21,4 @@ jobs: run: pip install -r requirements.txt - name: Run tests - run: pytest + run: pytest test --collect-only From ed6785f19237699756e0c2356680d7e2f3e63a08 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Wed, 30 Apr 2025 11:51:35 +0100 Subject: [PATCH 21/23] other small improvements in code-tester.yaml --- .github/workflows/code-tester.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-tester.yaml b/.github/workflows/code-tester.yaml index cd741c9..b666ada 100644 --- a/.github/workflows/code-tester.yaml +++ b/.github/workflows/code-tester.yaml @@ -2,7 +2,7 @@ name: Code Tester on: pull_request: - branch: [ master ] + branches: [ master ] jobs: test: @@ -21,4 +21,4 @@ jobs: run: pip install -r requirements.txt - name: Run tests - run: pytest test --collect-only + run: pytest tests --collect-only From d9f4f4018ab1c1f5fcc70b7df33b356bf10e137d Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Wed, 30 Apr 2025 12:02:59 +0100 Subject: [PATCH 22/23] fixing actions/checkout@v3 --- .github/workflows/code-tester.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/code-tester.yaml b/.github/workflows/code-tester.yaml index b666ada..5ac2f82 100644 --- a/.github/workflows/code-tester.yaml +++ b/.github/workflows/code-tester.yaml @@ -11,6 +11,8 @@ jobs: steps: - name: Download Repo In Docker uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v4 From b365c56a7bf48fa57dc0e71c8e70cf9dbfbbfc75 Mon Sep 17 00:00:00 2001 From: maximilien_notz Date: Wed, 30 Apr 2025 12:15:58 +0100 Subject: [PATCH 23/23] fixing trigger in code-tester.yaml --- .github/workflows/code-tester.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code-tester.yaml b/.github/workflows/code-tester.yaml index 5ac2f82..04dbacc 100644 --- a/.github/workflows/code-tester.yaml +++ b/.github/workflows/code-tester.yaml @@ -2,7 +2,8 @@ name: Code Tester on: pull_request: - branches: [ master ] + branches: #[ master ] + - ** jobs: test: