Signed-off-by: Kaspars Dambis <hi@kaspars.net> Signed-off-by: Chuck Adams <chaz@chaz.works> Signed-off-by: Ipstenu (Mika Epstein) <Ipstenu@users.noreply.github.com> Signed-off-by: Carrie Dils <cdils@users.noreply.github.com> Signed-off-by: cdils <cdils@users.noreply.github.com> Co-authored-by: Kaspars Dambis <hi@kaspars.net> Co-authored-by: Namith Jawahar <48271037+namithj@users.noreply.github.com> Co-authored-by: Andy Fragen <andy@thefragens.com> Co-authored-by: Chuck Adams <chaz@chaz.works> Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> Co-authored-by: Carrie Dils <cdils@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
3.2 KiB
Contributing
FAIR is an open project, and we welcome contributions from all.
FAIR is administered directly by the Technical Steering Committee. The FAIR Connect plugin is currently maintained by the Technical Independence Working Group, in conjunction with the FAIR Working Group; this maintenance will transition to the FAIR WG's responsibility once the independence work is complete.
All contributions must be made under the GNU General Public License v2, and are made available to users under the terms of the GPL v2 or later.
Contributors are required to sign-off their commits to agree to the terms of the Developer Certificate of Origin (DCO). You can do this by adding the -s parameter to git commit:
$ git commit -s -m 'My commit message.'
Please Note: This is adding a sign-off to the commit, which is not the same as signing your commits (which involves GPG keys).
Development Environment
This plugin is ready to use with wp-env for local development, with a default configuration included in the repository. npm run env is an alias for wp-env:
npm installto install wp-env and other dependencies.npm run env startto start the development server. Runnpm run env start -- --xdebug=coverageto enable Xdebug with test coverage reporting.npm run env logsto get the logs.npm run env stopto stop the development server.npm run clito run any CLI commands inside the environment, such asnpm run cli -- wp plugin list.
By default wp-env is configured with PHP 8.0 (our minimum supported version), as well as Airplane Mode to avoid inadvertent requests.
For linting and static analysis:
npm run lint:php:phpcsto run PHPCS (configured inphpcs.xml.dist).npm run lint:php:phpstanto run PHPStan (configured inphpstan.dist.neon).npm run format:php:phpcsto automatically fix PHPCS issues.npm run format:php:phpstanto automatically fix PHPStan issues.npm run cli -- composer phpstan-baselineto update the PHPStan baselinetests/phpstan-baseline.neonas you fix the reported issues.
For PHP unit tests:
npm run test:phpto run PHPUnit tests for WP single site (configured inphpunit.xml.dist).npm run test:php:multisiteto run PHPUnit multisite tests (configured inphpunit-multisite.xml.dist).
To enable test coverage reporting, start the environment with npm run env start -- --xdebug=coverage and then:
npm run coverage:php:singlefor coverage of single site tests.npm run coverage:php:multisitefor coverage of multisite tests.npm run coverage:php:fullfor coverage of both tests.
Configuring PHP and WP Versions
To run a specific version of PHP or WP with your local development environment, create a .wp-env.override.json file in the root of the repository with the following contents:
{
"phpVersion": "8.5",
"core": "https://wordpress.org/wordpress-6.9.zip"
}
and restart the development environment with npm run env start. Alternatively, set the WP_ENV_PHP_VERSION and WP_ENV_CORE environment variables before starting the environment.