build-your-own-git icon indicating copy to clipboard operation
build-your-own-git copied to clipboard

Add elixir 1.17

Open mikowitz opened this issue 6 months ago • 1 comments
trafficstars

Add Dockerfile, starter template, compiled starter, and solution for Elixir v1.17

Summary by CodeRabbit

  • New Features

    • Introduced Elixir starter templates and solution files for the "Build Your Own Git" challenge, including project setup, configuration, and entry-point code.
    • Added scripts for compiling and running Elixir projects both locally and in the CodeCrafters environment.
    • Implemented a basic command-line interface capable of initializing a minimal Git-like repository structure.
  • Documentation

    • Added comprehensive README and explanation files with setup instructions, challenge overview, and guidance for safe local testing.
  • Chores

    • Included project configuration, code formatting, and version control files to support best practices and maintainability.

mikowitz avatar Apr 26 '25 13:04 mikowitz

Walkthrough

This update introduces Elixir starter templates, solution files, and supporting infrastructure for a "Build Your Own Git" challenge. It adds shell scripts for compiling and running Elixir projects, project configuration files, code formatters, and documentation. The main program logic is implemented in a new CLI module with a main/1 function that handles command-line arguments to initialize a minimal Git repository structure. The update also includes Dockerfile and YAML configuration for environment setup, as well as solution files demonstrating the completed logic for the challenge's first stage.

Changes

Files/Paths Change Summary
compiled_starters/elixir/.codecrafters/compile.sh,
solutions/elixir/01-gg4/code/.codecrafters/compile.sh,
starter_templates/elixir/code/.codecrafters/compile.sh
Added shell scripts to compile the Elixir project into an escript executable and move it to a temp directory.
compiled_starters/elixir/.codecrafters/run.sh,
solutions/elixir/01-gg4/code/.codecrafters/run.sh,
starter_templates/elixir/code/.codecrafters/run.sh
Added shell scripts to execute the compiled Elixir binary with passed arguments.
compiled_starters/elixir/.formatter.exs,
solutions/elixir/01-gg4/code/.formatter.exs,
starter_templates/elixir/code/.formatter.exs
Added Elixir formatter configuration files specifying formatting rules for project files.
compiled_starters/elixir/.gitattributes,
solutions/elixir/01-gg4/code/.gitattributes
Added .gitattributes files to normalize line endings across platforms.
compiled_starters/elixir/.gitignore,
solutions/elixir/01-gg4/code/.gitignore,
starter_templates/elixir/code/.gitignore
Added .gitignore files to exclude build artifacts, dependencies, and temporary files from version control.
compiled_starters/elixir/README.md,
solutions/elixir/01-gg4/code/README.md
Added README documentation describing the challenge, usage instructions, and local testing guidance.
compiled_starters/elixir/codecrafters.yml,
solutions/elixir/01-gg4/code/codecrafters.yml
Added configuration files specifying debug settings and Elixir version for the environment.
compiled_starters/elixir/lib/main.ex,
starter_templates/elixir/code/lib/main.ex
Introduced CLI module with a main/1 function; in the starter, command logic is commented out and only a debug print is present.
solutions/elixir/01-gg4/code/lib/main.ex,
solutions/elixir/01-gg4/diff/lib/main.ex.diff
Added/activated CLI module with main/1 function implementing command-line handling for init and error cases.
compiled_starters/elixir/mix.exs,
solutions/elixir/01-gg4/code/mix.exs,
starter_templates/elixir/code/mix.exs
Added Mix project files defining project metadata, dependencies, and escript main module.
compiled_starters/elixir/your_program.sh,
solutions/elixir/01-gg4/code/your_program.sh
Added shell scripts for local compilation and execution of the Elixir program.
dockerfiles/elixir-1.17.Dockerfile Added Dockerfile for Elixir 1.17.2 on Alpine, copying source, installing dependencies, and caching build output.
solutions/elixir/01-gg4/explanation.md Added explanation file guiding users to implement and activate the command-line logic for the first stage.
starter_templates/elixir/config.yml Added YAML configuration specifying required executable and main editable file for the starter template.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI_Module as CLI.main/1
    participant FileSystem

    User->>CLI_Module: Run program with argv
    alt argv is ["init"]
        CLI_Module->>FileSystem: Create .git/objects and .git/refs
        CLI_Module->>FileSystem: Write .git/HEAD file
        CLI_Module-->>User: Print "Initialized git directory"
    else argv is [unknown_command]
        CLI_Module-->>User: Print "Unknown command"
        CLI_Module-->>User: Exit with status 1
    else argv is []
        CLI_Module-->>User: Print usage instructions
        CLI_Module-->>User: Exit with status 1
    end

Poem

In Elixir fields where code does sprout,
New scripts and docs are hopping out!
With .git and mix, the groundwork’s laid,
For Git-like tools by bunnies made.
Hop, compile, and run with glee—
The repo’s fresh as it can be!
🐇✨

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Apr 26 '25 13:04 coderabbitai[bot]