diff --git a/tests/oracle/cases/hooks.mjs b/tests/oracle/cases/hooks.mjs index 915fc92de..b3a6d7a77 100644 --- a/tests/oracle/cases/hooks.mjs +++ b/tests/oracle/cases/hooks.mjs @@ -182,6 +182,10 @@ export default [ { id: 'hadmin-ignore-value-missing', verb: 'hook-admin', workspace: 'hook-project', args: ['ignore-value', 'overused-font'], files: CACHE_FILES }, { id: 'hadmin-ignore-value-unknown-flag', verb: 'hook-admin', workspace: 'hook-project', args: ['ignore-value', 'overused-font', 'Inter', '--wat'], files: CACHE_FILES }, { id: 'hadmin-ignore-value-twice-updates-reason', verb: 'hook-admin', workspace: 'hook-project', files: CACHE_FILES, steps: [{ args: ['ignore-value', 'overused-font', 'Inter'] }, { args: ['ignore-value', 'overused-font', 'inter', '--reason=second'] }, { args: ['status'] }] }, + // upstream be87f5eb (#662): exact values for rules that cannot extract one are inert and refused + { id: 'hadmin-ignore-value-inert-exact', verb: 'hook-admin', workspace: 'hook-project', args: ['ignore-value', 'cramped-padding', 'padding: 4px 8px'], files: CACHE_FILES }, + { id: 'hadmin-ignore-value-inert-scoped', verb: 'hook-admin', workspace: 'hook-project', args: ['ignore-value', 'side-tab', 'Inter', '--file', 'a.css'], files: CACHE_FILES }, + { id: 'hadmin-ignore-value-inert-then-wildcard', verb: 'hook-admin', workspace: 'hook-project', files: CACHE_FILES, steps: [{ args: ['ignore-value', 'cramped-padding', 'padding: 4px 8px'] }, { args: ['ignore-value', 'cramped-padding', '*', '--file', 'index.html'] }, { args: ['status'] }] }, { id: 'hadmin-reset-empty', verb: 'hook-admin', workspace: 'hook-project', args: ['reset'], files: CACHE_FILES }, { id: 'hadmin-full-cycle', verb: 'hook-admin', workspace: 'hook-project', files: CACHE_FILES, steps: [{ args: ['ignore-rule', 'side-tab'] }, { args: ['ignore-file', 'x/**', '--local'] }, { args: ['ignore-value', 'overused-font', 'Inter'] }, { args: ['status'] }, { args: ['reset'] }, { args: ['status'] }] }, { diff --git a/tests/oracle/golden/hadmin-ignore-value-inert-exact.json b/tests/oracle/golden/hadmin-ignore-value-inert-exact.json new file mode 100644 index 000000000..97428c9b8 --- /dev/null +++ b/tests/oracle/golden/hadmin-ignore-value-inert-exact.json @@ -0,0 +1,7 @@ +{ + "stdout": "", + "stderr": "Error: cramped-padding has no extractable ignore value. Use /impeccable hooks ignore-value cramped-padding \"*\" --file to suppress it in matching files.\n", + "exit": 1, + "signal": null, + "files": {} +} diff --git a/tests/oracle/golden/hadmin-ignore-value-inert-scoped.json b/tests/oracle/golden/hadmin-ignore-value-inert-scoped.json new file mode 100644 index 000000000..e79c254c9 --- /dev/null +++ b/tests/oracle/golden/hadmin-ignore-value-inert-scoped.json @@ -0,0 +1,7 @@ +{ + "stdout": "", + "stderr": "Error: side-tab has no extractable ignore value. Use /impeccable hooks ignore-value side-tab \"*\" --file to suppress it in matching files.\n", + "exit": 1, + "signal": null, + "files": {} +} diff --git a/tests/oracle/golden/hadmin-ignore-value-inert-then-wildcard.json b/tests/oracle/golden/hadmin-ignore-value-inert-then-wildcard.json new file mode 100644 index 000000000..bb178c016 --- /dev/null +++ b/tests/oracle/golden/hadmin-ignore-value-inert-then-wildcard.json @@ -0,0 +1,25 @@ +{ + "steps": [ + { + "stdout": "", + "stderr": "Error: cramped-padding has no extractable ignore value. Use /impeccable hooks ignore-value cramped-padding \"*\" --file to suppress it in matching files.\n", + "exit": 1, + "signal": null + }, + { + "stdout": "Added cramped-padding=* scoped to index.html to shared detector.ignoreValues (.impeccable/config.json).\n", + "stderr": "", + "exit": 0, + "signal": null + }, + { + "stdout": "Impeccable design hook\n state: enabled\n shared file: .impeccable/config.json\n local file: .impeccable/config.local.json (not present)\n ignoreRules: (none)\n ignoreFiles: (none)\n ignoreValues: cramped-padding=* [index.html]\n maxFindings: 5\n maxChars: 8000\n env override: unset\n cache file: .impeccable/hook.cache.json (not present)\n", + "stderr": "", + "exit": 0, + "signal": null + } + ], + "files": { + ".impeccable/config.json": "{\n \"detector\": {\n \"ignoreRules\": [],\n \"ignoreFiles\": [],\n \"ignoreValues\": [\n {\n \"rule\": \"cramped-padding\",\n \"value\": \"*\",\n \"files\": [\n \"index.html\"\n ],\n \"createdAt\": \"\"\n }\n ]\n }\n}\n" + } +}