Skip to content

Latest commit

 

History

History
96 lines (64 loc) · 3.24 KB

CONTRIBUTING.md

File metadata and controls

96 lines (64 loc) · 3.24 KB

Contributing

The project follows the Open Knowledge International coding standards.

All PHP Code MUST conform to PHP-FIG accepted PSRs.

Flow Framework has a nice guide regarding coding standards:

Getting Started

With Docker:

  1. Clone the repo
  2. Install the Composer dependencies
    $ docker-compose run --rm tblschema composer install
  3. Run the tests
    $ ./docker-run-tests.sh

Without Docker:

  1. Clone the repo
  2. Install the Composer dependencies
    $ composer install
  3. Run the tests
    $ composer test

Phpunit - for unit tests

Travis

Phpunit is used for unit tests, you can find the tests under tests directory

Running Phpunit directly: vendor/bin/phpunit --bootstrap tests/autoload.php tests/

Coveralls - for coverage

Coveralls

when running composer test phpunit generates coverage report in coverage-clover.xml - this is then sent to Coveralls via a Github Action.

Scrutinizer-ci - for code analysis

Scrutinizer-ci

Scrutinizer-ci integrates with GitHub and runs on commits.

It does static code analysis and ensure confirmation to the coding stnadards.

At the moment, the integration with frictionlessdata repo is not working, you can setup a Scrutinizer-ci account for your fork and run against that.

php-cs-fixer - code style check & autofix

php-cs-fixer can be used to check and fix code style.

You need to manually install it, then you can run the following :

  • With Docker:
    # Check styles
    $ ./docker-style-check.sh
    # Automatically fix styles
    $ ./docker-style-fix.sh
  • Without Docker:
    # Check styles
    $ composer style-check
    # Automaticall fix styles
    $ composer style-fix

Publishing to Packagist

Packagist SemVer

  • Packagist is automatically updated by the Packagist GitHub service
  • all releases from GitHub appear as releases on Packagist automatically

Updating the json schema

The json schema for table schema might be modified from time to time, to update it run composer update-schema

Then, you should review the changes, and possibly write / update unit tests to match the new schema.