Create custom rules

How to create a custom rule

You may want to create a custom rule to check for very company-specific things. If it isn't company-specific it would be nicer to create a new default rule instead and submit it to the Prolint Open Source Project.
A custom rule is similar to a normal rule, but it is located in directory "prolint/custom/rules" instead "prolint/rules". The contents of directory "prolint/custom" (or its subdirs) is not maintained by the Prolint Open Source Project. In other words, this directory is not part of the Prolint installation and will never be overwritten when you install an update for Prolint.

How the "prolint/custom" directory is used by Prolint:

  • directory "prolint/custom/rules"
    may contain one or more rules and a file named "rules.d"
  • file "prolint/custom/rules/rules.d"
    may list custom rules that are located in directory "prolint/custom/rules". Its format is identical to file "prolint/rules/rules.d".
  • directory "prolint/custom/help/rules"
    may contain helpfiles (.htm) for custom rules or for overriding help for default rules.
Prolint imports file "prolint/custom/rules/rules.d" (if it exists) and file "prolint/rules/rules.d".
If a rule in the custom list happens to have the same RuleID as a default rule, then the custom list wins: the description and severity from prolint/custom/rules/rules.d replaces the standard description and severity from prolint/rules/rules.d.
In other words: the total list of available rules is a combination of records in prolint/custom/rules/rules.d and records in prolint/rules/rules.d.

When Prolint executes a rule, it will search the rule in this order (regardless if the rule was listed in "prolint/custom/rules/rules.d" or not):

  1. in directory "prolint/custom/rules"
  2. in Turbolint.dll
  3. in directory "prolint/rules"
Note that Prolint does not search for compiled r-code: it only tries to locate p-code.

When the Prolint Results Window searches for help on a specific rule, it will first search in directory "prolint/custom/help/rules" for a HTML file and if it doesn't find it, then it will browse to The OpenEdge Hive for on-line help.