From 4a77817a696efee09db103004aceb6bd1a0ee1a1 Mon Sep 17 00:00:00 2001 From: parsilver Date: Sat, 21 Nov 2026 00:19:22 +0700 Subject: [PATCH 1/8] test(quality): add the self-tests for the pull request quality gate The gate itself follows; these pin its behaviour first: changed-line parsing, Go coverage profiles, the CRAP ratchet, duplicate matching, waivers from the rendered PR description and the mutation budget. They fail now because .quality/gate.py does not exist yet. --- .quality/rendered-descriptions.json | 106 ++++ .quality/test_gate.py | 719 ++++++++++++++++++++++++++++ 2 files changed, 825 insertions(+) create mode 100644 .quality/rendered-descriptions.json create mode 100644 .quality/test_gate.py diff --git a/.quality/rendered-descriptions.json b/.quality/rendered-descriptions.json new file mode 100644 index 0000000..0d9099c --- /dev/null +++ b/.quality/rendered-descriptions.json @@ -0,0 +1,106 @@ +{ + "plain": { + "body": "Summary.\n\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "

Summary.

\n

Equivalent mutant: internal/core/core.go:3 the two branches return the same value

" + }, + "backtick_fence": { + "body": "Example:\n\n```text\nEquivalent mutant: internal/core/core.go:4 the two branches return the same value\n```\n\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "

Example:

\n
Equivalent mutant: internal/core/core.go:4 the two branches return the same value\n
\n

Equivalent mutant: internal/core/core.go:3 the two branches return the same value

" + }, + "tilde_fence": { + "body": "~~~~\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n```\nstill code\n~~~~\n", + "html": "
Equivalent mutant: internal/core/core.go:3 the two branches return the same value\n```\nstill code\n
" + }, + "unclosed_fence": { + "body": " ```\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "
Equivalent mutant: internal/core/core.go:3 the two branches return the same value\n
" + }, + "comment": { + "body": "\n\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "\n

Equivalent mutant: internal/core/core.go:3 the two branches return the same value

" + }, + "unclosed_comment": { + "body": "text Equivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "Equivalent mutant: internal/core/core.go:3 the two branches return the same value" + }, + "link_reference_title": { + "body": "[x]: /u \"\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n\"\n", + "html": "" + }, + "multi_line_alt": { + "body": "\"\nEquivalent\n", + "html": "

\"\nEquivalent

" + }, + "attribute_across_blank_lines": { + "body": "
\n", + "html": "" + }, + "hidden_elements": { + "body": "\n\n\n\n\n\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "<script>\n\nEquivalent mutant: internal/core/core.go:4 the two branches return the same value\n\n</script>\n<STYLE>\n\nEquivalent mutant: internal/core/core.go:4 the two branches return the same value\n\n</STYLE>\n\n

Equivalent mutant: internal/core/core.go:4 the two branches return the same value

\n\n

Equivalent mutant: internal/core/core.go:3 the two branches return the same value

" + }, + "continues_paragraph": { + "body": "Some text\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "

Some text
\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value

" + }, + "indented": { + "body": "Text.\n\n Equivalent mutant: internal/core/core.go:3 the two branches return the same value\n", + "html": "

Text.

\n
Equivalent mutant: internal/core/core.go:3 the two branches return the same value\n
" + }, + "adjacent": { + "body": "Equivalent mutant: internal/core/core.go:3 the two branches return the same value\nEquivalent mutant: internal/core/core.go:4 the two branches return the same value\n\nEquivalent mutant: internal/core/core.go:5 the two branches return the same value\n", + "html": "

Equivalent mutant: internal/core/core.go:3 the two branches return the same value
\nEquivalent mutant: internal/core/core.go:4 the two branches return the same value

\n

Equivalent mutant: internal/core/core.go:5 the two branches return the same value

" + }, + "crlf": { + "body": "```\r\ncode\r\n```\r\n\r\nEquivalent mutant: internal/core/core.go:3 the two branches return the same value\r\n", + "html": "
code\n
\n

Equivalent mutant: internal/core/core.go:3 the two branches return the same value

" + }, + "backtick_in_info_string": { + "body": "```a`b\n\n", + "html": "

```a`b

\n" + }, + "fence_inside_html_block": { + "body": "
\n```\n
\n