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!
[procedure: prolint/core/selectfiles.w, invoked from prolint/launch/start.p]
This dialog allows to select one or more sourcefiles
to lint. You can also select one or more directories:
Prolint will automatically scan directory-contents
looking for *.p and *.w (recursing into subdirectories
as well).
editor widget:
Type a list of filenames to lint, one filename on each line.
If you are using Progress 9 GUI you can use drag/drop to throw a bunch of sourcefiles into the editor widget.
toggle-box "Clear Outputhandlers":
When on (true), then all existing results will be cleared from the Results window. Other outputhandlers will also start a new, empty output.
[procedure: prolint/outputhandlers/logwin.w]
The Prolint Result window shows a browse widget containing all warnings from the most recent Prolint run.
When Prolint is working, the statusbar shows:
When Prolint is ready, the statusbar shows:
Window features:
The Prolint Desktop is simply a window with a couple of buttons on it, to launch several Prolint features from.
It is not exactly state of the art but comfortable.
It is especially comfortable when the Desktop is added to the PRO*Tools palette. There is a button near the bottom of the Prolint Desktop, labelled "Add to protools". Just press it and restart the PRO*Tools palette.
The button becomes invisible if there is already a program-name matching "*prolint*desktop*" in protools.dat.
# this file specifies which particular warnings should be excluded. The rules will # still be executed, but warnings are intercepted if they match this file. # You can also consider using {&_proparse_ prolint-nowarn(ruleid,ruleid)} directives # # format: # sourcefile|rules # # sourcefile : spell exactly as it appears in "Prolint result window", # wildcards are accepted. CAN-DO rules apply # rule : comma separated list of identifiers of the rules that gives the warning, # wildcards are accepted. CAN-DO rules apply # # empty lines or lines matching #* are ignored
When you have installed proparse and prolint you are ready to run Prolint for the first time.
Let's take the quick tour:
run the following statement from a Progress procedure editor:
RUN prolint/desktop.w.
In the Prolint Desktop, choose button "Lint files...".
You will now see a dialog, titled "Prolint - select files to lint".
This dialog contains an editor widget where you can enter a list of sourcefiles that will be processed by Prolint. Each filename should be entered on a new line, wildcards are currently not supported.
The easiest way to populate the list is by using drag and drop: open a Windows Explorer, select one or more
Progress sourcefiles and drag/drop them into the dialog.
for a GUI-window to modify the settings described here:
run prolint/core/lintcfg.w("")
Directory prolint/settings shows an example of how custom profiles can be used.
Each profile represents a subdirectory in prolint/settings.
Such a subdirectory may contain configuration files describing the behavior of Prolint.
The name of the custom profile is passed to Prolint as an input parameter. For example:
RUN prolint/core/prolint.p (sourcefile, ttemptablehandle, "relaxed", true).
tells prolint to look for configuration files in directory prolint/settings/relaxed.
When you add of change something to any Prolint source, you can do a regression test to see if you broke something.
You don't always want to run every rule. A "profile" contains a specification of the rules you want to skip and which outputhandlers you want to use. You can create as many profiles as you want.
For example, you may want to create a profile named "indexes" that only uses rules "nowhere", "sortaccess" and "wholeindex" and writes its output to HTML and to a tab-delimited file. Or you may want to ue profile "Ed4Win" that writes its output to the build-window in ED for Windows.
Each subdirectory in "prolint/settings" is a profile. Each of those subdirectories contains a couple of ascii-files to define the characteristics of the profile.
Profiles in "prolint/settings" are considered to be "shared" profiles.
This chapter will explain the various configuration options for 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 practices or violations against coding standards.
Prolint does not change or rewrite source code, it is no beauty.p.
Prolint works with a customizable library of "rules".
A "rule" is a specific test that Prolint can perform on source code. Some examples:
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:
"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 |
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.
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.
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.
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 |