diff --git a/.github/.gitmessage b/.github/.gitmessage new file mode 100644 index 0000000..d826fdc --- /dev/null +++ b/.github/.gitmessage @@ -0,0 +1,15 @@ +# : (max 50 chars) +# +# Types: +# Add — New content, files, examples +# Fix — Bug fix or correction +# Refactor — Code restructure (no new functionality) +# Document — README, comments, guides +# Update — Modify existing content +# Remove — Delete files or code +# Style — Formatting, whitespace, naming +# +# Body (optional): explain WHY, not WHAT (wrap at 72 chars) +# +# Footer (optional): reference issues — e.g. Closes #12 + diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..e49b648 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,59 @@ +name: Bug Report +description: Report code that doesn't compile or behaves incorrectly. +title: "[Bug] " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting! Please fill out the sections below. + + - type: input + id: file + attributes: + label: File / Example + description: Which file or example is affected? + placeholder: e.g. fundamentals/functions/methodes.h + validations: + required: true + + - type: textarea + id: description + attributes: + label: What happened? + description: Describe the bug — expected vs. actual behavior. + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: Steps to reproduce + description: How can the bug be triggered? + value: | + 1. Compile with `g++ ...` + 2. Run `./program` + 3. See error ... + validations: + required: false + + - type: dropdown + id: compiler + attributes: + label: Compiler + options: + - g++ (MinGW / Linux) + - MSVC (Visual Studio) + - clang++ + - Other + validations: + required: false + + - type: textarea + id: logs + attributes: + label: Error output / logs + description: Paste any compiler errors or runtime output. + render: shell + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..6c967ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Roadmap + url: https://github.com/PtiCalin/cpp/blob/main/ROADMAP.md + about: Check the learning roadmap before opening an issue. diff --git a/.github/ISSUE_TEMPLATE/new-content.yml b/.github/ISSUE_TEMPLATE/new-content.yml new file mode 100644 index 0000000..c7aa643 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-content.yml @@ -0,0 +1,41 @@ +name: New Content +description: Suggest a new example, topic, or project to add. +title: "[Content] " +labels: ["enhancement", "content"] +body: + - type: markdown + attributes: + value: | + Suggest something to add to the learning repository. + + - type: dropdown + id: phase + attributes: + label: Roadmap Phase + description: Which phase does this relate to? + options: + - "Phase 1 — Foundations" + - "Phase 2 — Modular Programming" + - "Phase 3 — OOP" + - "Phase 4 — File I/O" + - "Phase 5 — Console Projects" + - "Phase 6 — Next Steps" + - "Not sure" + validations: + required: true + + - type: textarea + id: description + attributes: + label: Description + description: What should be added and why? + validations: + required: true + + - type: textarea + id: references + attributes: + label: References / Resources + description: Any links, articles, or examples that could help? + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000..858c410 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,33 @@ +name: Question / Learning Note +description: Ask a question or log something you want to revisit. +title: "[Question] " +labels: ["question"] +body: + - type: markdown + attributes: + value: | + Use this to log a C++ question or concept you want to explore further. + + - type: input + id: topic + attributes: + label: Topic + placeholder: e.g. virtual destructors, template specialization + validations: + required: true + + - type: textarea + id: question + attributes: + label: Question / Note + description: What are you trying to understand? + validations: + required: true + + - type: textarea + id: context + attributes: + label: Context + description: Any code, links, or details that provide context. + validations: + required: false diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..1aa1a9e --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,60 @@ +# Repository labels — synced by .github/workflows/label-sync.yml + +# Type +- name: bug + color: "d73a4a" + description: Something isn't working. + +- name: enhancement + color: "a2eeef" + description: New feature or improvement. + +- name: content + color: "0075ca" + description: New example, topic, or project. + +- name: question + color: "d876e3" + description: Question or concept to revisit. + +- name: documentation + color: "0e8a16" + description: README, guide, or comment update. + +# Status +- name: stale + color: "ededed" + description: Inactive — will be closed soon. + +- name: pinned + color: "006b75" + description: Exempt from stale bot. + +- name: good first issue + color: "7057ff" + description: Good for newcomers. + +# Phase (maps to ROADMAP) +- name: "phase:1-foundations" + color: "fbca04" + description: "Phase 1 — Foundations" + +- name: "phase:2-modular" + color: "fbca04" + description: "Phase 2 — Modular Programming" + +- name: "phase:3-oop" + color: "fbca04" + description: "Phase 3 — OOP" + +- name: "phase:4-file-io" + color: "fbca04" + description: "Phase 4 — File I/O" + +- name: "phase:5-projects" + color: "fbca04" + description: "Phase 5 — Console Projects" + +- name: "phase:6-next" + color: "fbca04" + description: "Phase 6 — Next Steps" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..5aae3ac --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,42 @@ +# Release Drafter config — categorises merged PRs into release notes. + +name-template: "v$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" + +categories: + - title: "New Content" + labels: + - content + - enhancement + - title: "Bug Fixes" + labels: + - bug + - title: "Documentation" + labels: + - documentation + - title: "Maintenance" + labels: + - stale + +change-template: "- $TITLE (#$NUMBER) @$AUTHOR" +no-changes-template: "No changes since the last release." + +version-resolver: + major: + labels: [] + minor: + labels: + - enhancement + - content + patch: + labels: + - bug + - documentation + default: patch + +template: | + ## What's Changed + + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..476583d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +# CI — Compile check for C++ files +# Runs on every push and PR to main. + +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install g++ + run: sudo apt-get update && sudo apt-get install -y g++ + + - name: Compile standalone examples + run: | + echo "=== Compiling standalone .cpp files ===" + exit_code=0 + for file in $(find . -name '*.cpp' -not -path './.github/*'); do + echo "--- $file ---" + g++ -std=c++17 -Wall -Wextra -fsyntax-only "$file" 2>&1 || exit_code=1 + done + exit $exit_code diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml new file mode 100644 index 0000000..815a7d0 --- /dev/null +++ b/.github/workflows/label-sync.yml @@ -0,0 +1,25 @@ +# Label Sync — keep labels consistent via config file. +# Run manually or on push to .github/labels.yml. + +name: Sync Labels + +on: + push: + branches: [main] + paths: [.github/labels.yml] + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Sync labels + uses: EndBug/label-sync@v2 + with: + config-file: .github/labels.yml + delete-other-labels: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..ba9be44 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,25 @@ +# Release Drafter — auto-generates draft release notes from merged PRs. + +name: Release Drafter + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pull-requests: read + +jobs: + draft: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - uses: release-drafter/release-drafter@v6 + with: + config-name: release-drafter.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..c0803d8 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,29 @@ +# Stale — close inactive issues and PRs after a grace period. + +name: Stale + +on: + schedule: + - cron: "0 8 * * 1" # every Monday at 08:00 UTC + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: > + This issue has been inactive for 30 days and will be closed in 7 days + unless there is new activity. + stale-pr-message: > + This PR has been inactive for 30 days and will be closed in 7 days + unless there is new activity. + days-before-stale: 30 + days-before-close: 7 + stale-issue-label: stale + stale-pr-label: stale + exempt-issue-labels: pinned diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3c3b818 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,84 @@ +# Contributing + +> This is a personal learning repository for **IFT1166 — Programmation orientée objet en C++** (Université de Montréal, Hiver 2026). Contributions, suggestions, and feedback are welcome! + +--- + +## How to Contribute + +### Report a Bug or Suggestion + +Open an [issue](https://github.com/PtiCalin/cpp/issues/new/choose) using one of the provided templates: + +- **Bug Report** — code that doesn't compile or behaves incorrectly. +- **New Content** — suggest examples, topics, or projects to add. +- **Question** — ask a C++ question or flag something to revisit. + +### Submit a Pull Request + +1. Fork the repository. +2. Create a branch from `main` (`git checkout -b your-branch-name`). +3. Make your changes following the guidelines below. +4. Open a pull request — the PR template will guide you. + +--- + +## Guidelines + +### Repository Structure + +Each concept lives in its own folder: + +``` +topic-folder/ +├── README.md # Concise notes on the concept +├── example.cpp # Small runnable example +└── ... +``` + +- One concept per folder, one focused example per file. +- Keep `main()` minimal — delegate to functions and classes. +- Place exploratory code in `experiments/` first, then move to the proper folder once cleaned up. + +### Code Style + +Follow the project [STYLEGUIDE.md](STYLEGUIDE.md): + +- `snake_case` for variables and functions. +- `PascalCase` for class names. +- `UPPER_CASE` for macros and constants. +- 4 spaces indentation, one statement per line. +- Comments explain **why**, not **what**. + +### Commit Messages + +Use the project commit template (`.gitmessage`): + +``` +: + + +``` + +**Types:** `Add`, `Fix`, `Refactor`, `Document`, `Update`, `Remove`, `Style` + +Examples: +``` +Add: array sorting examples in fundamentals/ +Fix: off-by-one error in file-handling.cpp +Document: update ROADMAP Phase 3 checkboxes +``` + +### Checklist Before Submitting + +- [ ] Code compiles without errors (`g++ -Wall -Wextra`) +- [ ] Files are placed in the correct folder +- [ ] Related `README.md` files have been updated +- [ ] `UPDATES.md` has been updated (if applicable) +- [ ] No secrets, credentials, or personal data included + +--- + +## License + +By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).