Contributing to PDF::FacturX
Thank you for your interest! This module aims to be a clean, well-tested Factur-X / ZUGFeRD generator for the Perl ecosystem.
Development setup
git clone https://github.com/huguesmax/PDF-FacturX.git
cd PDF-FacturX
cpanm --installdeps .
perl Makefile.PL
make
Running tests
prove -lv t/
The test suite runs against:
- Pure XML tests (00–09): no external dependencies beyond
XML::LibXML - Embed tests (10–19): require
gs(Ghostscript) inPATH. Theyskip_allgracefully if it is missing.
Adding a test case
- Add a new
.tfile undert/following the existing numbering scheme. - For XML-only tests, use
XML::LibXML::XPathContextto assert structure. - For end-to-end tests, use
PDF::Builder->opento inspect the produced PDF/A-3 (do not grep raw bytes — PDF::Builder may compress the streams it writes).
Manual end-to-end validation
After making changes that affect XML or PDF structure, validate a sample output against the official online validator:
https://services.fnfe-mpe.org/
Or against the Mustang CLI (Java) for an offline check:
https://www.mustangproject.org/
Code style
- 4-space indentation, no tabs
- Avoid speculative abstractions
- Comments explain why, not what — names should already say what
- French is acceptable for internal comments and validation error messages (audience is mostly francophone given Factur-X's primary market)
Submitting changes
- Open an issue first for non-trivial changes
- Fork → branch → PR
- Include or update tests
prove -lv t/must pass with Ghostscript installed