woocommerce / woocommerce/code-reference

Hooks generator does not get all the PHP files to scan

Open
#20 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Twig
Stars
17
Forks
12
Avg merge
3h 58m
Merged PRs (30d)
3

Description

Context

At Ventures team we would like to generate a hooks document for our internal use and we found there is an awesome script in this repo that just do the things we want. Here's our PR woocommerce/google-listings-and-ads#1573, it basically copy most of the code from the script and then modify a bit to suit what we need.

The Problem

We found the script does not capture all the PHP files in the directory, the TLDR reason is the script cannot work in the case where there are more than two levels of paths. Please see the detailed explanation in our PR's comment: https://github.com/woocommerce/google-listings-and-ads/pull/1573#issuecomment-1173318631.

It also relates to #15.

Our solution may not fulfil the needs in this repo, also if there's any better ways to generate hooks documents (like using PHPDoc?) in your mind, we're happy to hear and learn about.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced generate-hook-docs.php script and review the detailed explanation in the linked google-listings-and-ads PR comment. Reproduce the generator against a directory with more than two levels of paths, then verify that all PHP files and their hooks are included in the generated document.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.