diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..5981e52a --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,174 @@ +# CodeRabbit config — folder.view3 (Unraid plugin: PHP emhttp + jQuery/vanilla JS + CSS + .plg) +# Lives on both `beta` (dev branch features are cut from) and `main` (default). +language: "en-US" + +reviews: + profile: "chill" + request_changes_workflow: false + + auto_review: + enabled: true + drafts: false + # main is the default branch and is always auto-reviewed; beta is the + # active dev branch that feature PRs target, so it must be listed too. + base_branches: + - "^beta$" # anchored — base_branches are regex; unanchored could match feature/beta etc. + + # Exclude vendored libraries, release artifacts, images, and the dev/ scratch + # tree so review focuses on hand-written plugin source. CI already validates + # the .plg (xmllint) and PHP syntax (php -l); don't re-lint those here. + path_filters: + - "!archive/**" + - "!screenshots/**" + - "!img/**" + - "!dev/**" + - "!**/scripts/include/**" + - "!**/styles/include/**" + - "!**/*.min.js" + - "!**/*.txz" + - "!**/*.png" + - "!**/*.jpg" + - "!**/*.gif" + - "!CHANGELOG-fixes.md" + + path_instructions: + - path: "src/**/*.{php,page}" + instructions: | + Server-side PHP for the Unraid emhttp environment: NO Composer/autoloader, + raw require_once includes, global $var / global config state. Review for: + + INPUT: Every request value ($_POST/$_GET/$_REQUEST) must be validated + BEFORE use — allowlist (in_array strict, ===) for enums/types, tight + regex for ids/paths, and reject (http_response_code 400 + exit) on + anything unexpected. fv3_validate_type() is the pattern; new endpoints + must not read a raw type/id/key and act on it un-checked. + + OUTPUT (XSS): htmlspecialchars/escape every dynamic value echoed into + HTML, into an inline