-
Notifications
You must be signed in to change notification settings - Fork 11
Add AI guidance assets for Drupal best practices #6
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
base: master
Are you sure you want to change the base?
Conversation
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| check_twig() { | ||
| echo "[CHECK] 3 Theming: preprocess coverage and template organization" | ||
| run_drush "ev 'print json_encode(array_keys(\\Drupal\\theme_handler\\ThemeHandler::defaultThemeList()));'" \ | ||
| | jq 'keys[]' >/dev/null |
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.
Use existing ThemeHandler namespace in twig check
The twig validation runs drush ev against \Drupal\theme_handler\ThemeHandler::defaultThemeList(), but Drupal core exposes the theme handler as \Drupal\Core\Extension\ThemeHandler (usually accessed via the theme_handler service) and there is no \Drupal\theme_handler\ThemeHandler class. As written, drush ev will fatally error with “Class … not found” whenever the twig check (or all) is executed, stopping the script before any theming validation runs.
Useful? React with 👍 / 👎.
| check_assets() { | ||
| echo "[CHECK] 3 Theming: browser support and utility-first frameworks used selectively" | ||
| run_drush "ev 'print json_encode(\\Drupal\\core\\Asset\\LibraryDiscovery::getInfo());'" \ | ||
| | jq 'keys[]' >/dev/null |
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.
Fix LibraryDiscovery namespace casing in assets check
The assets check calls \Drupal\core\Asset\LibraryDiscovery::getInfo(), but the class lives under \Drupal\Core\Asset\LibraryDiscovery. Because Composer’s PSR‑4 autoloader is case sensitive, the lowercase core prefix will not resolve on a typical Linux install, causing drush ev to throw a class-not-found error and abort the script whenever the assets check runs.
Useful? React with 👍 / 👎.
| check_forms() { | ||
| echo "[CHECK] 2.7 Forms: prefer Webform over core Contact for complex needs" | ||
| run_drush "pm:list webform" >/dev/null |
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.
Avoid unsupported argument to pm:list in forms check
The forms validation uses drush pm:list webform, but pm:list (pml) does not take module names as positional arguments—it only accepts options like --type or --status. Passing webform causes Drush to exit with a “too many arguments” error, and with set -e the entire site-building validation halts whenever the forms check (or all) is selected.
Useful? React with 👍 / 👎.
Summary
aifolderTesting
Codex Task