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

Script to extract hooks #1741

Draft
wants to merge 3 commits into
base: 8.x
Choose a base branch
from

Conversation

thomasnares
Copy link
Contributor

@thomasnares thomasnares commented Oct 30, 2023

Questions Answers
Branch? 8.x
Description? Cleaned the script to generate hook list, but there are still some bugs on regex.

This script allows to extract hooks for documentation for devdocs, from a release archive, or from a directory

Usage is documented within the script

But it must be finished and fixed:

Issues with this script:

  • Fix some regexes to match hooks in codebase (you must scan all files, and identify where hooks are called)
  • Fix the name cleaning array (linked with regex matching)
  • Detect if hooks uses check_exceptions, chain and array_return

I'm still not sure we can match all hooks with regexes against the codebase.

Solution

Another approach would be to refactor the HookFinder with the famous php-parser library which produces AST : https://github.com/nikic/php-parser (the one used by PHPStan to detect bugs).

As the hook list is in perpetual evolution and changes at every release, this should be a priority to fix this script and use it regularely

@github-actions github-actions bot added the 8.x label Oct 30, 2023
README.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant