Skip to content

Comments

Globalize pyenv rule #1100

Merged
scorphus merged 35 commits intonvbn:masterfrom
gkodosis:master
Feb 11, 2021
Merged

Globalize pyenv rule #1100
scorphus merged 35 commits intonvbn:masterfrom
gkodosis:master

Conversation

@gkodosis
Copy link
Contributor

@gkodosis gkodosis commented Jun 1, 2020

Getting pyenv_no_such_command.py rule as base, I created an env_no_such_command.py script able to hanlde all env related commands. Transforming, in this way, the pyenv rule in a more global one.

This commit was originated and fixes #1074

@gkodosis
Copy link
Contributor Author

@scorphus Is everything good with my pr, would you like me to enhance anything? 😄

Copy link
Collaborator

@scorphus scorphus left a comment

Choose a reason for hiding this comment

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

Thanks for contributing, @gkodosis!

At a first look:

  • The changes cause tests to fail
  • There're no changes to the README.md file
  • There are no tests for the changes introduced
  • The special cases in the original rule are lost

I think a general rule is less useful than a specific one. Considering a specific rule, it is already hard for TheFuck to get a valid, useful recommendation. Let alone a general one.

So, IMO, the original rule should be kept as is and additional rules should be created for each of those other commands, each of them with their particularities (if any). Also, each of them with enabled_by_default properly set, including the original—that being an improvement.

What do you think?

@gkodosis
Copy link
Contributor Author

Yes I totally agree with all your points. My only thoughts lie on the matter of the global rule. Due to the almost identical commands of the env packages, my solution seemed really convenient. Though, if you think is better to make separate files for each command, I will work on it for sure. Probably the testing process will be more efficient in this way as well.

@scorphus
Copy link
Collaborator

The identical parts of the rules could be kept in a single, separate “devenv” submodule imported by all of the rules. Such submodule would reside under thefuck/specific along with other specific ones. This way there’s less repetition. What do you think?

@gkodosis
Copy link
Contributor Author

Yes, that' s a great idea! I will work on it, as well as the requested changes and come up with a new pr.

@gkodosis
Copy link
Contributor Author

Need to check why the tests fail, otherwise I think I managed to fullfill the requested changes and they seem really great!

@gkodosis
Copy link
Contributor Author

gkodosis commented Jul 6, 2020

@scorphus Hello again, everything seems to work pretty great! Unfortunately, your idea of integrating some of the common code of the rules to specific/devenv.py was making the tests to fail, so I decided to simplify it. Hope I find some extra time and manage to integrade more of the common code of the rules in a couple of weeks.

Thank you for your help!

@scorphus
Copy link
Collaborator

scorphus commented Jul 8, 2020

You're on fire! 🔥 I hope I soon have time to review it more thoroughly. Thanks!

@scorphus scorphus self-requested a review July 8, 2020 19:54
@scorphus scorphus added this to the 3.31 milestone Jul 8, 2020
@gkodosis
Copy link
Contributor Author

Hello @scorphus I didn't have any time to enhance this commit, as I can understand you haven't found any time to review it in order to merge it as well. Let me know about your status 😎

Copy link
Collaborator

@scorphus scorphus left a comment

Choose a reason for hiding this comment

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

Hey, @gkodosis, sorry for taking long to review.

Please, accept my apologies. I completely overlooked the fact that the commands of all virtual env managers are practically identical.

I guess I'll reset to one of your previous commits and make a couple small adjustements.

@scorphus scorphus force-pushed the master branch 2 times, most recently from f24735b to 57e7e37 Compare February 9, 2021 20:33
@gkodosis
Copy link
Contributor Author

Hey @scorphus,

It's okay don't worry! Let me know if you need any help, I will be glad to help 😃

@scorphus
Copy link
Collaborator

I'd love if you could spare a review 🙌

Copy link
Contributor

@dvjn dvjn left a comment

Choose a reason for hiding this comment

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

@scorphus how about these suggestions?

Copy link
Collaborator

@scorphus scorphus left a comment

Choose a reason for hiding this comment

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

Thanks @gkodosis for contributing 🚀 and @divykj for the review 🙌

:shipit:

@scorphus scorphus merged commit 0e34c23 into nvbn:master Feb 11, 2021
@gkodosis
Copy link
Contributor Author

Sorry guys I was pretty busy and saw the updates just now, cheers @divykj for the review! Glad to help @scorphus 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyenv is supported, rbenv, nodenv and goenv not supported

3 participants