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

Updated hook decorator #446

Closed

Conversation

zAlweNy26
Copy link
Member

@zAlweNy26 zAlweNy26 commented Sep 1, 2023

Description

In this way, a plugin developer can either define the hook using the function name or using the name argument of the @hook with the help of the autocomplete thanks to the Literal CAT_HOOKS.

Thanks to this PR, we still support the old way of defining hooks, but also adding a new and easier way to define them.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@zAlweNy26
Copy link
Member Author

@pieroit @nicola-corbellini what do you think about this?

@pieroit
Copy link
Member

pieroit commented Sep 1, 2023

@pieroit @nicola-corbellini what do you think about this?

I'll leave the PR open, but I'm not convinced it is worth it to have this just for autocomplete

@zAlweNy26
Copy link
Member Author

But nothing breaks, everything continues to work as before, there is simply this new extra mode for those who want to 😁

@nicola-corbellini
Copy link
Member

apart from merging this or not, I'd populate the Literal list programmatically rather than hard coding the hooks' names

@zAlweNy26
Copy link
Member Author

How can it be done?

@zAlweNy26 zAlweNy26 marked this pull request as draft December 3, 2023 22:56
@zAlweNy26 zAlweNy26 closed this Dec 6, 2023
@zAlweNy26 zAlweNy26 deleted the update-hook-decorator branch July 1, 2024 18:39
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.

3 participants