To ensure that developers are following coding guidelines or other standards, you can evaluate their source files. You can create preoperation triggers to run user-defined programs, and cancel the commands that trigger them.
For example, you may want to disallow checkin of C-language files that do not satisfy quality metrics. Suppose that you have defined an element type, c_source, for C language files (*.c).
cleartool mktrtype -element -all -eltype c_source ^
-preop checkin -exec "\\neon\scripts\appl_met.bat %CLEARCASE_PN%" ApplyMetrics
This trigger type ApplyMetrics applies to all elements; it fires when any element of type c_source is checked in. (When a new c_source element is created, it is monitored.) If a developer attempts to check in a c_source file that fails the appl_met.bat test, the checkin fails.
NOTE: The appl_met.bat file can read the value of CLEARCASE_PN from its environment. Having it accept a file-name argument provides flexibility because the batch file can be invoked as a trigger action, and developers can also use it manually.
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |