Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add practice exercise ledger #1367

Merged
merged 4 commits into from
Sep 25, 2023
Merged

Add practice exercise ledger #1367

merged 4 commits into from
Sep 25, 2023

Conversation

jiegillet
Copy link
Contributor

It has been a while since I added an exercise :)
This one got tests added a while back.

It's a refactor exercise, it was my first time doing it, I don't know if I went too far with the bad code.
Some pieces of the code would only work on the given test cases, is that fair game?

@github-actions
Copy link
Contributor

Thank you for contributing to exercism/elixir 💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.

Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:

  • General steps

    • 🏆 Does this PR need to receive a label with a reputation modifier (x:size/{tiny,small,medium,large,massive})? (A medium reputation amount is awarded by default, see docs)
  • Any exercise changed

    • 👤 Does the author of the PR need to be added as an author or contributor in <exercise>/.meta/config.json (see docs)?
    • 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
    • 📜 Does the design file (<exercise>/.meta/design.md) need to be updated to document new implementation decisions?
  • Practice exercise changed

    • 🌲 Do prerequisites, practices, and difficulty in config.json need to be updated?
    • 🧑‍🏫 Are the changes in accordance with the community-wide problem specifiations?
  • Practice exercise tests changed

    • ⚪️ Are all tests except the first one skipped?
    • 📜 Does <exercise>/.meta/tests.toml need updating?

Automated comment created by PR Commenter 🤖.

Copy link
Member

@angelikatyborska angelikatyborska left a comment

Choose a reason for hiding this comment

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

Yaaay, Jie is contributing here again 😻

Some pieces of the code would only work on the given test cases, is that fair game?

Absolutely.

I'm approving, feel free to merge with or without making any more changes.

@type entry :: %{amount_in_cents: integer(), date: Date.t(), description: String.t()}

@spec format_entries(currency(), String.t(), list(entry())) :: String.t()
def format_entries(currency, locale, entries) do
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the locale could also get its own custom type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about it, I think I decided not to because somehow I thought capital letter were not allowed in atoms... But that's silly, so I made it a type after all :)

"""
Date | Description | Change\s\s\s\s\s\s\s
01/01/2015 | Freude schoner Gotterf... | ($1,234.56)
"""
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean for the boilerplate solution to be failing this test? In the markdown exercise, the boilerplate passes all tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad! I made a value wrong on purpose, but I made it too wrong and somehow forgot to check :(

@jiegillet jiegillet merged commit 2d8d075 into main Sep 25, 2023
11 checks passed
@jiegillet jiegillet deleted the jie-ledger branch September 25, 2023 12:23
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