Prolint

Prolint is a tool for automated source code review of Progress 4GL code. It reads one or more sourcefiles and examines it for bad programming practice
When you are interested Prolint, you are encouraged to subscribe to this group where you find the on-line tools to collaborate and discuss Prolint. There is a discussion forum, you can submit issues (for bugs and enhancement requests), you can modify the on-line documentation. So subscribe, and then don't forget to go to your subscription details to enable the e-mail notification!


How to create a new outputhandler

An outputhandler must be located in directory prolint/outputhandlers, and has to be listed in
file prolint/outputhandlers/choices.d.


Columns in file prolint/outputhandlers/choices.d:

  1. programname.
  2. minimum required Progress version (integer).

    only the main version, like 8 or 9, is supposed to be listed here.

    The outputhandler will not be run if this value is less than the current Progress version

  3. supported window-system.

    possible values:

    "GUI" this outputhandler will only run in a GUI session
    "TTY" this outputhandler will only run in a ChUI session
    "*" this outputhandler will run in any window-mode
    "" this outputhandler will only run in batch-mode
  4. short description (only one line)

Each outputhandler is loaded persistently by prolint.p, but prolint will never delete the procedure. The outputhandler has to delete itself when ready,
usually from within the event-procedure for event "Prolint_FinalizeResults".

The outputhandler subscribes to, and responds to (some) of the following published events:


PROCEDURE Prolint_InitializeResults :  
   DEFINE INPUT PARAMETER pClearOutput AS LOGICAL NO-UNDO.
END PROCEDURE.              

Event Prolint_InitializeResults is published when prolint.p starts.


Prolint Source Overview

All tests are performed by "rules", these are programs in directory prolint/rules.
This is where the actual knowledge about Progress source code review is implemented.


Extract adecomm.pl

Unless you are running Progress version 8 or TTY mode, you will need to extract adecomm.pl.

This is because the codepreview window contains an editor, which uses the same syntax-coloring editor as the Progress Appbuilder, and adecomm.pl contains the includefiles that makes this possible.

Instructions

Open a command shell and change directory to your DLC directory. In the following example I will assume this is directory "c:\Program Files\Progress" :


cd \progra~1\progress\gui

set DLC=c:\progra~1\progress

Installation

The pages in this chapter will guide you through the installation of Prolint.


Prolint Issue Tracker

Prolint reads your source code and looks for bugs and does suggestions for improvements. This Prolint project works in conjuction with the Prolint group

If you have an idea for a new rule, please use the Issue Tracker and use the combo-boxes to specify "component=rule" and "category=feature request".

But of course you can use the Issue Tracker for other issues too.


Where to install Prolint

Prolint must be a subdirectory of one of the directories in your PROPATH. If, for example, you already have an existing directory c:\p4gl\tools in your PROPATH you would end up with:

c:\p4gl\tools                  (existing directory, already in your PROPATH) 

c:\p4gl\tools\prolint (contains prolint sources)

 This way you will not have to change your PROPATH to run Prolint.


Appbuilder Integration

The Progress Appbuilder already has a menu-item "Check Syntax", you can also add a menu-item "Prolint" for the extensive code inspection of Prolint.

To create the new menu-item you will have to install a custom event. This is how: locate file "gui/adecomm/_adeevnt.p" in the DLC directory and add this single line to it:

{prolint/ab/custom_evnt.i}  

You may have to compile...save adecomm/_adeevnt.p and restart the Appbuilder before the change has effect.

Now, when you open a file in the Appbuilder and choose the Prolint menu-item, the currently selected file will be inspected by Prolint. You can configure a profile with the name "Appbuilder" to specify which rules and outputhandlers are used.
Notice however that only the saved file will be inspected, not the version in memory that may be different from the saved version!


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.

Customization

This book will teach you how you can customize Prolint.


Rules

This is the list of rules, or actually the list of help-pages for each rule.
Not every rule in this list is by default available in your Prolint setup: the "Contributed rules" are not. Contributed rules can be downloaded separately to your prolint/contribs/rules directory from subversion path http://websvn.oehive.org/listing.php?repname=prolint&path=/trunk/contrib...

Click Here when you want to add a new Rule helppage.


# Syndicate content