From bf486bb98868e5e459e4d81a90c6450739313744 Mon Sep 17 00:00:00 2001 From: orangepizza Date: Sat, 28 Mar 2026 10:26:47 +0900 Subject: [PATCH] Update copilot instruction to match actual PR rule (#6873) old version had instruction to use bash-only [[ ]] test, remove it and add rules for DNS script writing from https://github.com/acmesh-official/acme.sh/issues/343 --- .github/copilot-instructions.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d407607a..af0e8147 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -39,7 +39,6 @@ Please adhere to the previous format: organize the feedback into a single, struc * **Function Usage:** Recommend wrapping complex or reusable logic within clearly named functions. * **Local Variables:** Check that variables inside functions are declared using the `local` keyword to avoid unintentionally modifying global state. * **Naming Convention:** Variable names should use uppercase letters and underscores (e.g., `MY_VARIABLE`), or follow established project conventions. -* **Test Conditions:** Encourage the use of Bash's **double brackets `[[ ... ]]`** for conditional tests, as it is generally safer and more powerful (e.g., supports pattern matching and avoids Word Splitting) than single brackets `[ ... ]`. * **Command Substitution:** Encourage using `$(command)` over backticks `` `command` `` for command substitution, as it is easier to nest and improves readability. ### 4. External Commands and Environment @@ -48,13 +47,14 @@ Please adhere to the previous format: organize the feedback into a single, struc * **Use existing acme.sh functions whenever possible.** For example: do not use `tr '[:upper:]' '[:lower:]'`, use `_lower_case` instead. * **Do not use `head -n`.** Use the `_head_n()` function instead. * **Do not use `curl` or `wget`.** Use the `_post()` and `_get()` functions instead. +* **keep it sh compatible, do not use bash-only syntax.** We need to cross platforms between Linux/BSD/Mac. --- ### 5. Review Rules for Files Under `dnsapi/`: * **Each file must contain a `{filename}_add` function** for adding DNS TXT records. It should use `_readaccountconf_mutable` to read the API key and `_saveaccountconf_mutable` to save it. Do not use `_saveaccountconf` or `_readaccountconf`. - +* **keep it shell only** Do not add more dependencies. common tools, such as grep or sed etc are ok to use. do not depend on python or perl etc. ## ❌ Things to Avoid @@ -64,4 +64,3 @@ Please adhere to the previous format: organize the feedback into a single, struc -