ATLAS Quality Assurance - Tools/RuleChecker
About RuleChecker
RuleChecker is a tool produced by ITC-IRST. The tool is also used by ALICE, and LHCb, and by the CERN IT Controls group.
The tool provides a common parser, and each experiment has its own set of rules.
The ATLAS rules were coded by the IRST developement team, following a collaboration agreement which provides for delivery of four milestones over a two year period.
First report [pdf, 9 pages] of the use of Rulechecker in ATLAS.
Which ATLAS Rules can be checked?
Please see the qa TWIKI page for the latest news, including which rules are currently checked, and how to check a subset of rules.
CA1 CA2 CA4 CA7 CA9 CA11 CA12 |
Parts of C++ to avoid |
CB1 CB2 CB5 | Object oriented programming |
CC4 | Conversions |
CF5 | Control Flow |
CI1 CI3 CI4 CI6 CI7 CI8 CI9 |
Class Interface |
CL8 CL11 | Object Life Cycle |
CN2 |
new and delete |
CO1 CO2 CO3 CO4 |
Code organization |
CP4 CP10 |
Portability |
CR3 |
Readability and maintainability |
CS1 CS2 |
Static and Global objects |
NC1 NC2 NC5 NC6 NC7 |
Naming Conventions |
NF1 NF2 |
File Naming |
NI1 NI2 |
Illegal Naming |
SC1 |
Comments |
SG1 SG2 SG3 SG4 SG5 |
General Style |
How do I use it?
RuleChecker is integrated in the ATLAS Release from 5.1.0 onwards.
Your code MUST
compile without errors before you attempt to use a code checking tool.
From the ../cmt directory of the package, which you wish to check, simply type
gmake -i rulechecker
By default the output will be written to a text file with the suffix *.viol in the directory:
../CodeCheck/rulechecker
To change this, override the macro "CODECHECK_OUTPUT_DIRECTORY".)
One file will be written for each .cxx file where errors have been found.
You can of course issue the command in broadcast mode from a container package
cmt broadcast - gmake rulechecker
In the above gmake commands, the "-" and the "-i" tell gmake not to stop if an error is encountered.
RuleChecker is also run using the RTT tool.
TBD - need reference
TBD - there is only one command in the last pre box
Are there any known problems?
Yes, some .cxx files still produce java parse errors. In these cases the tool will still produce some output, and gmake will continue (if the "-" option was used).
Some ATLAS files have been observed to put the tool into an indeterminate state (infinite loop and timeout or seg fault). Please inform qa of any bugs.
How does it work in cmt?
RuleChecker is written in Java. Each rule is a implemented as a java class. For more information about using RuleChecker read the User Guide [pdf, 17 pages].
At CERN the tool is installed in the LCG common area. (/afs/cern.ch/sw/lcg/contrib/rulechecker).
Under CMT RuleChecker works as a document provider. RuleChecker Makefiles are produced from Fragments in the Tools/CodeCheck package.
To avoid working on container packages, the Makefile first looks to see if a directory called ../src exists. It uses CMT to get a list of .cxx files, which the package is contributing to the release.
The ATLAS installation creates symbolic links to all the ATLAS configuration files before starting.
.cxx files are copied to a temporary working directory, symbolic links are made to the Install area, conserving the correct arborescence.
The compiler is first called to pre-process the code (-E option) (*.i and *.ii files are produced in the working directory). RuleChecker parses the pre-processed files.
At the end the temporary directory is removed.
Running RuleChecker takes about 3 times longer than just running gmake.