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
scripts/_common.py
: add a shared Python file to move duplicated code
#12755
scripts/_common.py
: add a shared Python file to move duplicated code
#12755
Conversation
scripts/_common.py
: add a shared Python file to move duplicated code
25f7717
to
839c057
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to open a issue myself and start the refactoring another day, thank you for already starting this work :)
I took a quick look at the code, and in general it looks good indeed.
I think we can extract more functions, for example: the "--page" code in main(), I think we can extract the gathering of the target paths and maybe more things.
I will see if I can review this PR more carefully later.
839c057
to
5bf9b0d
Compare
It is WIP 🚧 and definitely not ready to merge for the time being, but feel free to add commits 😄 |
This comment has been minimized.
This comment has been minimized.
(I didn't took a closer look at the code yet) Unfortunately it's not possible to comment on unmodified lines, but It would be good to remove the |
I will definitely look into that. I found out yesterday that the |
Does this problem also happens with Do you know which function(s) is/are causing this error? |
I did not check. Due to the fact that
It is on line 237 and 243 in |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
It was a typo after all... |
This comment was marked as resolved.
This comment was marked as resolved.
7b1a484
to
5afdf6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a suggestion to clarify the color handling that would require updating all code that uses any ANSI code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we use pathlib, it's easy to resolve relative paths to absolute paths.
This allow us to remove the dependency on the current directory, specially on the stage
function.
BTW, adding tests for _common.py
was an excellent idea. Good choice on pytest, too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continuing the modification of stage
's parameters.
Co-authored-by: Vítor Henrique <87824454+vitorhcl@users.noreply.github.com>
797cc44
to
c70329d
Compare
c126865
to
ba583c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor suggestion on the get_tldr_root
error message that makes it clearer for anyone not used with environment variables, allowing them to search for the term.
Co-authored-by: Vítor Henrique <87824454+vitorhcl@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we use absolute paths in stage()
, there's no reason to use relative paths in these places.
Obviously, we need to update the variable names and not take the relative path
Co-authored-by: Vítor Henrique <87824454+vitorhcl@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution. Tested all the changes locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for your contribution.
#12745 (comment)