To get up and running, install the dependencies and run the full build:
yarn
yarn ciYou can also inspect the other available dev flows scripts:
yarn runIf you would like to check the impact of your changes on a sample code, edit the scripts/single-printer-run/_input.java file and run
node scripts/update-test-output.js -singleThe prettified code will be output in scripts/single-printer-run/_output.java.
It is also possible to prettify an entire repository by running the following command:
node scripts/update-test-ouput.js -repository relative/path/to/the/repositoryIt will then be output inside test-samples/repository-name.
To check the stability of the reformating, you can run several times Prettier with the -times flag (e.g. 5 times):
node scripts/update-test-output.js -single -times 5If you run:
node scripts/update-test-ouput.jsIt will simply update all the tests located in test/unit-test folder.
If you would like to run all the tests, simple use the following command:
yarn testThe prettier-java source code is (unsurprisingly) formatted using prettier. Make sure to properly format the source code before committing by running:
yarn run format:fixAll Unit tests in this project are implemented with the Mocha testing framework and the Chai assertion library.