Enforce repository formatting in GitHub CI (#2023)
Summary: Pull Request resolved: https://github.com/react/yoga/pull/2023
Add a dedicated GitHub Actions check for the repository-owned formatter contract and document the same commands for contributors. The job provisions the Java and Python runtimes needed by Yoga’s Kotlin and Python formatters before running
yarn format-check.
Reviewed By: cipolleschi
Differential Revision: D119662616
fbshipit-source-id: eeb03aa263d3e528ceb5b7f0884ce232153608ee
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Yoga

Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages.
Building
Yoga’s main implementation targets C++ 20 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests.
While not required, this script will use ninja if it is installed for faster builds.
Yoga is additionally part of the vcpkg collection of ports maintained by Microsoft and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
Adding Tests
Many of Yoga’s tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to
gentest/fixtures.To generate new tests from added fixtures:
yarn installto install dependencies for the test generator.yarn gentestin theyogadirectory.Debugging
Yoga provides a VSCode “launch.json” configuration which allows debugging unit tests. Simply add your breakpoints, and run “Debug C++ Unit tests (lldb)” (or “Debug C++ Unit tests (vsdbg)” on Windows).