Automated Checks

Sahana has some automated checks in the form of perl and bash scripts to check the adherance of the code to the coding conventions. This especially guides new developers and allows the release team to automatically inspect the stability of code. The automated checks are located in the /test/code/ directory of the CVS code sahana-phase2 module.

Checks available

Master Check

  • check - Is the master check and performs all available checks on the code base (php, html, css, etc)

Check Scripts

  • check_php - Runs all the php only file checks (anything that is prefixed with check_php_
  • check_php_license - checks for the existance of the LGPL license
  • check_php_namespace - checks for conflicts in the function namespace

Inspection Tools

  • list_shn_namespace - alphabetically lists all the functions begining with shn_

Using the scripts

Except for the master check the check scripts require you to pipe in the list of files to be checked into STDIN.

e.g. <file list generator> | <check script>

File list generators can for example

ls *.php | check_php_license
find *.inc | check_php_namespace
test/code/find_phpcode | check_php

find scripts Find scripts allow you to easily list a subset of files you are looking for. Find scripts available are:

  • find_phpcode - searches all the *.php and *.inc files recursively
find_phpcode - will recursively search on the current director
find_phpcode ../mod ../inc ../conf - will search mod inc and conf directories

QR Code
QR Code dev:automated_check (generated for current page)