Skip to content

Applied Pony Coding Style Standards. - #23

Merged
redvers merged 1 commit into
mainfrom
apply_pony_coding_standards
Jan 13, 2026
Merged

Applied Pony Coding Style Standards.#23
redvers merged 1 commit into
mainfrom
apply_pony_coding_standards

Conversation

@redvers

@redvers redvers commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

Files Reformatted:

Core library files:

  • libxml2/xml2doc.pony - Fixed multiline function signatures, removed parentheses around conditions, split long lines
  • libxml2/xml2error.pony - Fixed match statement indentation (pipes align below match keyword)
  • libxml2/xml2node.pony - Fixed multiline function signatures, removed parentheses around conditions, split long lines
  • libxml2/xml2xpathobject.pony - Fixed multiline function signatures, removed parentheses around conditions, split long lines
  • libxml2/xpathtype.pony - Fixed type alias formatting with proper alignment
  • libxml2/_test.pony - Already compliant, no changes needed

Test files:

  • libxml2/_tests/basic_tests.pony - Already compliant, no changes needed
  • libxml2/_tests/coverage_tests.pony - Split long lines, fixed indentation, reformatted XML test data
  • libxml2/_tests/error_tests.pony - Split long commented line
  • libxml2/_tests/xpath.pony - Fixed function call formatting, split long lines

Key Style Guide Rules Applied:

  1. 80-column line length - All lines now fit within 80 characters
  2. Multiline function parameters - Each parameter on separate line, return type with : on own line, => on separate line
  3. Match expressions - Case pipes NOT indented, aligned with match keyword
  4. No parentheses - Removed unnecessary parentheses around conditions in if and while
  5. Proper indentation - 2 spaces, no tabs

All tests pass, confirming the formatting changes didn't break any functionality!

Summary of Changes

Files Reformatted:

Core library files:
  - libxml2/xml2doc.pony - Fixed multiline function signatures, removed parentheses around conditions, split long lines
  - libxml2/xml2error.pony - Fixed match statement indentation (pipes align below match keyword)
  - libxml2/xml2node.pony - Fixed multiline function signatures, removed parentheses around conditions, split long lines
  - libxml2/xml2xpathobject.pony - Fixed multiline function signatures, removed parentheses around conditions, split long lines
  - libxml2/xpathtype.pony - Fixed type alias formatting with proper alignment
  - libxml2/_test.pony - Already compliant, no changes needed

Test files:
  - libxml2/_tests/basic_tests.pony - Already compliant, no changes needed
  - libxml2/_tests/coverage_tests.pony - Split long lines, fixed indentation, reformatted XML test data
  - libxml2/_tests/error_tests.pony - Split long commented line
  - libxml2/_tests/xpath.pony - Fixed function call formatting, split long lines

Key Style Guide Rules Applied:

  1. 80-column line length - All lines now fit within 80 characters
  2. Multiline function parameters - Each parameter on separate line, return type with : on own line, => on separate line
  3. Match expressions - Case pipes NOT indented, aligned with match keyword
  4. No parentheses - Removed unnecessary parentheses around conditions in if and while
  5. Proper indentation - 2 spaces, no tabs

All tests pass, confirming the formatting changes didn't break any functionality!
@claude

claude Bot commented Jan 13, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


@redvers
redvers merged commit 932575c into main Jan 13, 2026
7 checks passed
@redvers
redvers deleted the apply_pony_coding_standards branch January 13, 2026 02:12
redvers added a commit that referenced this pull request May 21, 2026
Four PonyCheck property tests verify the README's "If it crashes,
it's a bug" claim across the public API:

  fuzz/create-element/property      - createElement with random names
                                      and content (incl. NUL bytes,
                                      invalid UTF-8)
  fuzz/set-get-prop/property        - setProp/getProp/unsetProp with
                                      random names and values
  fuzz/xpath-expr/property          - xpathEval with random ASCII
                                      printable expressions
  fuzz/append-child-chain/property  - createElement + appendChild
                                      chains of varying depth

Each property asserts two layered invariants. Outer fallible calls
that take fixed valid inputs (Xml2Doc.create(), createWithRoot,
parseDoc of a fixed valid doc, serialize) run inside
h.assert_no_error so a regression on those surfaces as a localised
PonyCheck failure. Inner partial calls on fuzzed input stay inside a
bare try ... end; only a process abort or segfault fails the test.

A FuzzParseDoc property was investigated and removed. Feeding
non-trivially varied non-XML inputs to Xml2Doc.parseDoc reliably
segfaults or aborts with "free(): invalid pointer" after a handful
of distinct failed parses. The crash is cumulative across inputs but
does not reproduce when the same input is reparsed in a loop,
suggesting state corruption in libxml2's internal handling of
repeated parse errors. The in-file comment in fuzz_tests.pony
preserves the investigation summary; the parseDoc crash is filed as
separate follow-up work.

The other fuzz tests avoid this hazard by exercising APIs other than
parseDoc, starting from a freshly created or fixed valid document.

No release note: test-only changes don't get user-facing entries in
this project (cf. PRs #22 and #23 not in CHANGELOG).
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