Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_repport.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
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:
- 🔥 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
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/auto-fill-algo-name.yaml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/auto-fill-bug-title.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/code-tester.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Code Tester

on:
pull_request:
branches: #[ master ]
- **

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Download Repo In Docker
uses: actions/checkout@v3
with:
fetch-depth: 0

- 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
run: pytest tests --collect-only
81 changes: 81 additions & 0 deletions .github/workflows/issue-Automatic-renaming.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Issue Automatic Renaming

on:
issues:
types: [opened, edited]

permissions:
issues: write

jobs:
rename-issue:
runs-on: ubuntu-latest
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);

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
});

- name: Rename for Bug Report Issues
uses: actions/github-script@v7
if: contains(github.event.issue.body, '### Type')
with:
script: |
const body = context.payload.issue.body;
console.log("Issue Body:\n", body);

const typeMatch = /### Type\s+(.+?)\s*(###|$)/s.exec(body);
const Type = typeMatch ? typeMatch[1].trim() : null;

if (!Type) {
console.log("🚫 Could not find Type in Markdown.");
return;
}

const typeMap = {
"🧮 Algorithm Implementation": "🧮",
"🛠 CI/Tooling Issue": "🛠",
"📘 Algorithm Documentation": "📘",
"🖋 General Documentation": "🖋",
"🧪 Test Failure or Adding Testcase": "🧪",
"❓ Other / Not Sure": "❓",
};
const typeIcon = typeMap[Type] || "❓";

const rawTitle = context.payload.issue.title;
if (rawTitle.startsWith("🔥") || rawTitle.startsWith("🛑") || rawTitle.startsWith("⚠️") || rawTitle.startsWith("❓")) {
console.log("✅ Title already formatted correctly.");
return;
}

const issueNumber = context.issue.number;
const updatedTitle = `⚠️ - ${typeIcon} [Bug]: ${rawTitle}`;

console.log(`🔧 Updating issue title to: ${updatedTitle}`);

await github.rest.issues.update({
...context.repo,
issue_number: issueNumber,
title: updatedTitle
});
100 changes: 52 additions & 48 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 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.

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:
Expand Down Expand Up @@ -75,7 +110,7 @@ AlgoHub/

```

### Algorithm README.md
### Algorithm README

The README.md inside the **New_Algorithm** folder should follow the following template.

Expand Down Expand Up @@ -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.
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy
rich
pytest
2 changes: 1 addition & 1 deletion tests/datastructures/stack/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ def test_string_representation() -> None:
assert "Stack" in rep
assert "3" in rep
assert "2" in rep
assert "1" in rep
assert "1" in rep