Drupal distribution and install profile to help UK councils collaborate and share Drupal code.
To install LocalGovDrupal use the Composer-based project template.
composer create-project --stability dev localgovdrupal/localgov-project MY_PROJECT
Note: If developing locally and you want to force composer to clone again
from source rather than use composer cache, you can add the --no-cache
flag.
composer create-project localgovdrupal/localgov-project MY_PROJECT --stability dev --no-cache
If you just want to pull in the latest changes to LocalGovDrupal run composer
update with the --no-cache
flag.
composer update --no-cache
If you want to be sure you are getting the latest commits when developing, clearing composer cache, deleting the folders and re-running composer update seems to be a solid approach:
rm -rf web/profiles/contrib/ web/modules/contrib/ web/themes/contrib/;
composer clear-cache; composer update --with-dependencies --no-cache;
lando start;
lando drush si localgov -y;
See CONTRIBUTING.md for current contribution guidelines.
In the early development stages, most issues will be tracked in this repository https://github.com/localgovdrupal/localgov/issues.
Development issues relating to specific projects or module should be tracked in the project repository. In the future we might set up a separate repository for centralised issue tracking of bug reports for end users.
The main development environment in use is currently Lando – a Docker based development environment that works on Linux, MacOS and Windows.
@todo Document Lando setup.
PHP CodeSniffer is installed as a dev dependency by Composer and configured to use Drupal coding standards and best practices. It is a good idea to run these before committing any code. All code in pull requests should pass all CodeSniffer tests.
To check code using Lando run:
lando phpcs
To attempt to automatically fix coding errors in Lando run:
lando phix
The included phpunit.xml.dist
file contains configuration for automatically
running the LocalGovDrupal test suite.
To run all LocalGicDrupal tests with Lando use:
lando phpunit
To run all the tests for a specific module use:
lando phpunit web/modules/contrib/localgov_my_module
Tests can be filtered using the --filter
option. To only run a specific test
use:
lando phpunit --filter=myTestName