Skip to content

feat(compare): add sorting logic for BlockQuotes in blockQuotesEqual function#240

Merged
k1LoW merged 1 commit intomainfrom
blockquote-should-be-sort
Jul 13, 2025
Merged

feat(compare): add sorting logic for BlockQuotes in blockQuotesEqual function#240
k1LoW merged 1 commit intomainfrom
blockquote-should-be-sort

Conversation

@k1LoW
Copy link
Owner

@k1LoW k1LoW commented Jul 13, 2025

This pull request introduces a change to the blockQuotesEqual function in compare.go to ensure consistent ordering of BlockQuote slices before comparison. Sorting is implemented using a custom function that considers nesting level, paragraph count, and serialized paragraph content.

Enhancements to blockQuotesEqual:

  • compare.go: Added sorting logic to the blockQuotesEqual function using slices.SortFunc. The sorting criteria include nesting level, the number of paragraphs, and serialized paragraph content, ensuring consistent order for comparison. Error cases during JSON serialization are handled by treating the elements as unequal.

@k1LoW k1LoW self-assigned this Jul 13, 2025
@k1LoW k1LoW marked this pull request as ready for review July 13, 2025 12:43
@github-actions
Copy link
Contributor

Code Metrics Report

main (b2d5f47) #240 (4b42742) +/-
Coverage 35.9% 35.6% -0.3%
Code to Test Ratio 1:0.9 1:0.9 -0.1
Test Execution Time 9s 9s 0s
Details
  |                     | main (b2d5f47) | #240 (4b42742) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          35.9% |          35.6% | -0.3% |
  |   Files             |             16 |             16 |     0 |
  |   Lines             |           2248 |           2272 |   +24 |
+ |   Covered           |            809 |            811 |    +2 |
- | Code to Test Ratio  |          1:0.9 |          1:0.9 |  -0.1 |
  |   Code              |           4505 |           4539 |   +34 |
  |   Test              |           4161 |           4161 |     0 |
  | Test Execution Time |             9s |             9s |    0s |

Code coverage of files in pull request scope (70.4% → 58.1%)

Files Coverage +/- Status
compare.go 58.1% -12.3% modified

Reported by octocov

@k1LoW k1LoW merged commit 7cf96aa into main Jul 13, 2025
1 check passed
@k1LoW k1LoW deleted the blockquote-should-be-sort branch July 13, 2025 12:50
@github-actions github-actions bot mentioned this pull request Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant