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

[Helpers\helper] Refactor helper.nim #1273

Merged
merged 52 commits into from
Nov 23, 2023

Conversation

RickBarretto
Copy link
Collaborator

@RickBarretto RickBarretto commented Sep 16, 2023

Description

This PR cleans helper.nim up and refactor some functions, making them more readable and maintainable.

Type of change

  • Code cleanup
  • Unit tests (added or updated unit-tests)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (implementation update, or general performance enhancements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (documentation-related additions)

* avoids unnecessarily nesting code
* improves the readability and avoids ambiguity
* newBlock isn't copying elements one by one, but doing a shallow copy, so no big problems here
* avoids code repetition and unnecessary nesting
@github-actions github-actions bot added the helpers Issues related to Helper modules label Sep 16, 2023
@RickBarretto RickBarretto changed the title [helpers] Refactor helper.nim [Helpers\helper] Refactor helper.nim Sep 16, 2023
@RickBarretto RickBarretto marked this pull request as draft September 16, 2023 01:12
@RickBarretto
Copy link
Collaborator Author

RickBarretto commented Sep 16, 2023

@drkameleon I have two questions to do.

  1. What do you think about this?
  2. Are "examples" strictly necessary to be generated when it's a function? (group DOCGEN's available attributes) Or will our docgen just ignore it? I'm afraid about break the documentation generation, but I can decouple it again if you tell me...

@RickBarretto
Copy link
Collaborator Author

RickBarretto commented Sep 16, 2023

@drkameleon, the error it's emitting is this:

image

IDK if this is related to any modification on helper.nim.

@drkameleon
Copy link
Collaborator

@drkameleon I have two questions to do.

  1. What do you think about this?
  2. Are "examples" strictly necessary to be generated when it's a function? (group DOCGEN's available attributes) Or will our docgen just ignore it? I'm afraid about break the documentation generation, but I can decouple it again if you tell me...
  1. Great idea to be honest (I'll have to look at the final rewrite, but I I like your idea!)
  2. Examples are generated only for docgen (basically, when I want to generate the documentation, I first build Arturo accordingly - with ./build.nims docs - and then use that binary for the doc generation). At some point, the examples formed part of all normal binaries too; but honestly having all this text data just packed into every binary, in case sb needs it... I don't know. Regarding "breaking" it... well, go ahead, and we'll see later! haha 😉

@drkameleon
Copy link
Collaborator

@drkameleon, the error it's emitting is this:

image

IDK if this is related to any modification on helper.nim.

Hmm... it doesn't seem like it's related at all - to me, it looks like one of the various leftover bugs with the Quantity implementation (unfortunately). I'll have to go through them one by one, I guess it could be my very next PR ;)

@github-actions github-actions bot added the unit-test Unit tests label Sep 16, 2023
@RickBarretto RickBarretto marked this pull request as ready for review September 16, 2023 18:29
@RickBarretto
Copy link
Collaborator Author

@drkameleon finished!

If you think I should do more things here, you can tell me!

@drkameleon
Copy link
Collaborator

P.S. I haven't forgotten about this. I just want to take my time and look into properly before merging (and given the amount of work that I've had lately, well... I guess I decided to wait a tiny bit so that I don't do it in a hurry). But I will ;)

@drkameleon drkameleon self-requested a review November 23, 2023 07:14
Copy link
Collaborator

@drkameleon drkameleon left a comment

Choose a reason for hiding this comment

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

After... almost 2 months, I finally got around to have a look into it lol.

Well, the truth is it's totally looking good (if I spot anything I don't particularly like, I'll look into it at a different moment too, but I really doubt it).

Very organized and clean! 😉

@drkameleon
Copy link
Collaborator

Ready to merge! 🚀

@drkameleon drkameleon merged commit 6118c58 into arturo-lang:master Nov 23, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helpers Issues related to Helper modules unit-test Unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants