* clean up all but header incrementing in Creating-Transport.md * make Device-Dependencies.md mdl happy * make Entities.md as mdl happy as possible... one long table line left * make mdl as happy as possible for index.md * clean up Introduction.md as much as possible * minor formatting cleanup... move each icon onto its own row * make ack and notes the same style * clean Macros.md up * clean Rules.md up as much as possible * tweak one line a bit to get it to format a bit nicer * a bit more format tweaking, making sure it does not sure with > * clean up as much as possible for Templates.md * make Testing.md as mdl happy as possibly * clean Transports.md up as much as possible * clean as many issues as possible for Alerts.md * clean up as much of ARP.md as possible * clean up as much as possible for Bills.md * make DeviceGroups.md as mdl happy as possible * cleanup Devices.md * make as mdl happy as possible Inventory.md and index.md * mdl cleanup for Logs.md and PortGroups.md * make Ports.md and Routing.md as happy as possible * clean up Services.md, Switching.md, and Systems.md as much as possible * more markup cleanup * lots more md cleanup udner Devloping/ * reapply bits from #10343 that accidentally got removed when merging
1.6 KiB
source: Developing/Validating-Code.md path: blob/master/doc/
Validating Code
As part of the pull request process with GitHub we run some automated build tests to ensure that the code is error free, standards compliant and our test suite builds successfully.
Rather than submit a pull request and wait for the results, you can run these checks yourself to ensure a more seamless merge.
All of these commands should be run from within the librenms directory and can be run as the librenms user unless otherwise noted.
Install composer (you can skip this if composer is already installed).
curl -sS https://getcomposer.org/installer | php
Composer will now be installed into /opt/librenms/composer.phar.
Now install the dependencies we require:
./composer.phar install
Once composer is installed you can now run the code validation script:
./scripts/pre-commit.php
If you see Tests ok, submit away :)
then all is well. If you see
other output then it should contain what you need to resolve the issues and re-test.
Git Hooks
Git has a hook system which you can use to trigger checks at various
stages. Utilising the pre-commit.php
you can make this part of your
commit process. You can do this in two ways:
- If you already make use of
.git/hooks/pre-commit
then you can add:
./scripts/pre-commit.php
to be excecuted when you run git commit
.
- You can symlink the
pre-commit.php
file so it's executed directly on agit commit
:
ln -s /opt/librenms/scripts/pre-commit.php /opt/librenms/.git/hooks/pre-commit