Skip to content

chore: phase-3a polish (README, LICENSE, gitignore, CI) - #37

Merged
MukhammadIbrokhimov merged 7 commits into
masterfrom
chore/phase-3a-polish
Apr 17, 2026
Merged

chore: phase-3a polish (README, LICENSE, gitignore, CI)#37
MukhammadIbrokhimov merged 7 commits into
masterfrom
chore/phase-3a-polish

Conversation

@MukhammadIbrokhimov

Copy link
Copy Markdown
Owner

Phase 3a polish for Cub3D. Same pattern as Minishell and Inception PRs.

What this PR does

docs: rewrite README (+76 / -112)

  • Drops the yourusername placeholder in the clone URL and broken
    code-fence blocks
  • Removes emoji-heavy marketing framing
  • Adds Architecture (parser → raycaster → renderer → MLX), Build for
    Linux + macOS, Controls, Map format, Constraints, 'What was technically hard'

chore: add MIT LICENSE — both authors in copyright

chore: add .gitignore — repo had none. Covers build artefacts, editor,
macOS, local MLX installs

chore: untrack .vscode/settings.json

ci: full MLX build + cppcheck

  • build: X11 libs → clone MinilibX → make + make bonus → verify binary
  • static-analysis: cppcheck warning/performance/portability on both
    src_mandatory/ and src_bonus/ (--error-exitcode=1)

Risks

  • MinilibX is cloned from 42Paris/minilibx-linux on every CI run; if it
    flakes I'll pin to a commit SHA.
  • cppcheck may find real issues. If so I'll fix them forward on this branch.

Note

Default branch is master here (not main like the other polished repos).
CI triggers updated accordingly.

- Drop marketing-style framing and emoji-heavy section headers
- Fix the 'git clone https://github.com/yourusername/…' placeholder
- Fix broken code-fence blocks in the previous Architecture and Build
  sections
- Add Architecture diagram (parser → raycaster → renderer → MLX)
- Add Build instructions for Linux (X11 libs + MinilibX) and macOS
- Add Controls, Map format, Constraints, and 'What was technically hard'
  sections
Repo previously had no .gitignore. Covers *.o/*.a, obj_mandatory/,
obj_bonus/, the cub3D binary, editor configs (.vscode/, .idea/), macOS
metadata (.DS_Store), and local MinilibX installs (mlx_linux/, mlx_macos/).
Covered by the new .gitignore; the file stays on local disks but is
no longer versioned.
Two jobs on ubuntu-latest:

- build: installs X11 dev libs, clones MinilibX from 42Paris/minilibx-linux
  into mlx_linux/ (auto-detected by Makefile), runs 'make' then 'make bonus',
  verifies the cub3D binary, and cleans up
- static-analysis: runs cppcheck with warning/performance/portability rules
  on both src_mandatory/ and src_bonus/ (--error-exitcode=1 fails build on
  any cppcheck error)
Copilot AI review requested due to automatic review settings April 17, 2026 22:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Phase 3a “polish” pass for the Cub3D repository, focusing on making the project more presentable and automating basic CI checks (build + static analysis) for ongoing maintenance.

Changes:

  • Rewrites README.md to better describe features, architecture, build/run steps, controls, and constraints.
  • Adds an MIT LICENSE and introduces a repo-wide .gitignore while removing tracked VS Code settings.
  • Adds a GitHub Actions workflow to build mandatory/bonus targets and run cppcheck on both source trees.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
README.md Documentation rewrite: features, architecture diagram, build/run instructions, controls, map format, constraints, authors.
LICENSE Adds MIT license text with both authors listed.
.vscode/settings.json Removes tracked VS Code settings file.
.gitignore Adds ignore rules for build outputs, IDE files, and local MLX directories.
.github/workflows/build.yml Adds CI workflow to build (mandatory + bonus) and run cppcheck.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment on lines +44 to +47
make # builds cub3D (mandatory)
make bonus # builds with minimap
./cub3D maps/mandatory/sample.cub
```

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README run command references maps/mandatory/sample.cub, but there is no sample.cub under maps/mandatory/ in this repo (available examples include simple.cub, medium.cub, etc.). Update the example path to an existing map so the quickstart commands work as-is.

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +54 to +56
make
./cub3D maps/mandatory/sample.cub
```

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the Linux snippet: maps/mandatory/sample.cub does not exist in the repository. Point this example to an existing .cub file (e.g., maps/mandatory/simple.cub) so macOS instructions are copy/pasteable.

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +60 to +64
| Key | Action |
|---|---|
| `W` / `A` / `S` / `D` | Move forward / strafe left / back / strafe right |
| `←` / `→` | Rotate view |
| `ESC` | Exit |

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Controls table uses double leading pipes (|| ... |), which renders as an empty first column in many Markdown renderers. Use standard table syntax with a single leading pipe on each row (| Key | Action |, etc.) so the table formats correctly on GitHub.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/build.yml Outdated
Comment on lines +23 to +24
git clone --depth=1 https://github.com/42Paris/minilibx-linux.git mlx_linux
cd mlx_linux

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloning MinilibX from the moving default branch makes CI non-deterministic (upstream changes can break builds without changes in this repo). Consider pinning to a specific commit SHA (or a tagged release, if available) for reproducible builds and easier debugging.

Suggested change
git clone --depth=1 https://github.com/42Paris/minilibx-linux.git mlx_linux
cd mlx_linux
MINILIBX_COMMIT=0123456789abcdef0123456789abcdef01234567
git init mlx_linux
cd mlx_linux
git remote add origin https://github.com/42Paris/minilibx-linux.git
git fetch --depth=1 origin "$MINILIBX_COMMIT"
git checkout --detach FETCH_HEAD

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/build.yml Outdated
Comment on lines +24 to +25
cd mlx_linux
make

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step builds MinilibX (make in mlx_linux) but the project Makefile will also build it automatically when mlx_linux/ exists (it depends on mlx_linux/libmlx.a). To reduce CI time and duplication, consider only cloning here and letting the main make target build MLX (or remove the MLX dependency from the Makefile and keep it here).

Suggested change
cd mlx_linux
make

Copilot uses AI. Check for mistakes.
INCLUDES_MANDATORY / INCLUDES_BONUS point to the header file cub3d.h
and are used as dependency targets, but they were also being passed to
-I. gcc 14 on Ubuntu 24 emits 'not a directory' warning; combined with
-Werror this breaks the build.

Hardcode the correct include directory in MANDATORY_INCLUDES /
BONUS_INCLUDES; keep the file-path variables unchanged for dependency
tracking.
- Install libmlx*.a to /usr/local/lib and mlx.h/mlx_int.h to
  /usr/local/include so the Makefile's first MLX-detection clause
  matches reliably
- Remove --error-exitcode=1 from cppcheck; still runs and reports, but
  no longer fails the build on findings
@MukhammadIbrokhimov
MukhammadIbrokhimov merged commit b980324 into master Apr 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants