Skip to content

Commit d2c98eb

Browse files
committed
Correct some mistakes following Copilot CI advice
1 parent 9adece6 commit d2c98eb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

instructions/moodle.instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
applyTo: '*.php, *.js, *.mustache, *.xml, *.css, *.scss'
2+
applyTo: '**/*.php, **/*.js, **/*.mustache, **/*.xml, **/*.css, **/*.scss'
33
description: 'Instructions for GitHub Copilot to generate code in a Moodle project context.'
44
---
55

66
# Project Context
77

8-
This repository contains a Moodle project. It is based on Moodle version XXXX (specify version).
8+
This repository contains a Moodle project. Ensure that any generated code is compatible with the specific Moodle version used in this project (for example, Moodle 3.11, 4.1 LTS, or later).
99

1010
It includes:
1111
- Plugin development (local, block, mod, auth, enrol, tool, etc.)
@@ -19,15 +19,15 @@ It includes:
1919
- PHP must be compatible with the core version (e.g., PHP 7.4 / 8.0 / 8.1).
2020
- Do not use modern syntax that is not supported by core if it breaks compatibility.
2121
- Class naming must use Moodle namespaces.
22-
- Use the MVC structure in plugins (classes/output, classes/form, db/, lang/, templates/…).
22+
- Follow Moodle’s standard plugin directory layout (for example: classes/output, classes/form, db/, lang/, templates/…).
2323
- Mandatory use of Moodle security functions:
2424
- `$DB` with SQL placeholders
2525
- `require_login()`, `require_capability()`
2626
- Parameters handled with `required_param()` / `optional_param()`
2727

2828
# Code Generation Rules
2929

30-
- When creating new classes, use the namespace `vendor\pluginname`.
30+
- When creating new PHP classes in plugins, use the Moodle component (Frankenstyle) namespace that matches the plugin's component name, e.g. `local_myplugin`, `mod_forum`, `block_mycatalog`, `tool_mytool`.
3131
- In plugins, always respect the structure:
3232
- /db
3333
- /lang
@@ -45,7 +45,7 @@ It includes:
4545
# Examples of What Copilot Should Be Able to Answer
4646

4747
- "Generate a basic local plugin with version.php, settings.php, and lib.php."
48-
- "Create a new table in install.xml and an upgrade script in upgrade.php."
48+
- "Create a new table in db/install.xml and an upgrade script in db/upgrade.php."
4949
- "Generate a Moodle form using moodleform."
5050
- "Create a renderer with Mustache to display a table."
5151

0 commit comments

Comments
 (0)