[Prolint-cvs] SF.net SVN: prolint: [259] trunk/prolint
Brought to you by:
johnallengreen,
jurjen
From: <ju...@us...> - 2006-03-13 21:30:22
|
Revision: 259 Author: jurjen Date: 2006-03-13 13:29:41 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=259&view=rev Log Message: ----------- customize.i is now empty. All properties are now in prolint.properties.p and are evaluated at run-time Modified Paths: -------------- trunk/prolint/customize.i trunk/prolint/desktop.w trunk/prolint/filters/exclude.p trunk/prolint/filters/filterparams.i trunk/prolint/filters/ignoreab.p trunk/prolint/filters/nowarn.p trunk/prolint/help/customization.menu trunk/prolint/help/integrations.menu trunk/prolint/help/newrule.htxt trunk/prolint/help/opensource.htxt trunk/prolint/help/release.ini trunk/prolint/help/turbolint.htxt trunk/prolint/lintcfg.w trunk/prolint/lintsuper.p trunk/prolint/outputhandlers/PRO4mfile.p trunk/prolint/outputhandlers/dlgfilter.w trunk/prolint/outputhandlers/ed4win.p trunk/prolint/outputhandlers/logexcel.p trunk/prolint/outputhandlers/logfile.p trunk/prolint/outputhandlers/logwin.w trunk/prolint/outputhandlers/logwin8.w trunk/prolint/outputhandlers/prolintdb.p trunk/prolint/outputhandlers/regrlog.p trunk/prolint/outputhandlers/showhtml.p trunk/prolint/outputhandlers/tabfile.p trunk/prolint/prolint.p trunk/prolint/rtb/checkin-handler.p trunk/prolint/ruleparams.i trunk/prolint/rules/ifindent.p trunk/prolint/rules/message.p trunk/prolint/rules/sortaccess.p trunk/prolint/rules/strattrib.p trunk/prolint/rules/varusage.p trunk/prolint/rules/wholeindex.p Added Paths: ----------- trunk/prolint/help/appbuilder.htxt trunk/prolint/help/contact.html trunk/prolint/prolint.properties.p trunk/prolint/propsuper.p Modified: trunk/prolint/customize.i =================================================================== --- trunk/prolint/customize.i 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/customize.i 2006-03-13 21:29:41 UTC (rev 259) @@ -25,79 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ================================================================== */ - -/* - &GLOBAL-DEFINE EXCLUDE-AppbuilderStuff - if defined, don't suppress prolint warnings for statements that are generated by Application Builder. - if not defined, try to suppress warnings for statements that are generated by Application Builder. -*/ + /* this include-file is empty. Prolint does not use it anymore. + Instead, we now use prolint/prolint.properties.p to set props at run-time! */ -/* - &GLOBAL-DEFINE EXCLUDE-SupportPragmas - if defined, ignore {&proparse prolint-nowarn()} directives - if not defined, suppress warnings for statements directly following a matching {&proparse prolint-nowarn(ruleid)} -*/ - - -/* - &GLOBAL-DEFINE EXCLUDE-Nowarn-list - if defined, don't read nowarn.lst - if not defined, read nowarn.lst and suppress warnings for statements listed in nowarn.lst -*/ - - -/* - &GLOBAL-DEFINE EXCLUDE-Status-timer - This defines how logwin.w counts time. - if not defined, logwin.w shows total time for prolint except time for PreAnalyze (in prolint.p) - in defined, logwin.w shows total time for prolint -*/ - &GLOBAL-DEFINE EXCLUDE-Status-timer - - -/* - &GLOBAL-DEFINE EXCLUDE-remove-ldbname - if defined, don't remove the ldbname from tablename (send "sports.customer" to outputhandler) - if not defined, remove the ldbname from tablename (send "customer" to outputhandler) -*/ - - -/* - &GLOBAL-DEFINE EXCLUDE-superprocedure - if defined, procedure lintsuper.p will not be a super procedure (Progress 8 compatible). - if not defined, procedure lintsuper.p will be a super procedure when compiled with Progress 9. -*/ - - -/* - &GLOBAL-DEFINE IndentTabSize 8 - if defined, rule ifindent.p will use this value for the tab size when calculating indents. - if not defined, rule ifindent.p will use a tab size of 8 when calculating indents. -*/ - -/* &GLOBAL-DEFINE varusage_OutputParamsAreUsed YES|NO - customization for rule "varusage": - if YES, output parameters are always considered to be "used" and will not cause a warning. - if NO, output parameters are considered to be "not used" unless they are explicitly assigned */ - -&IF DEFINED(varusage_OutputParamsAreUsed)=0 &THEN -&GLOBAL-DEFINE varusage_OutputParamsAreUsed YES -&ENDIF - - -/* &GLOBAL-DEFINE Turbolint_IgnoreRules [comma-separated list without quotes] - IF turbolint contains a 3GL version of a rule but you prefer to run the 4GL version, - add the name of the rule to this comma-separated list. - For example, to use the 4GL versions of "noundo" and "varusage" : - &GLOBAL-DEFINE Turbolint_IgnoreRules noundo,varusage -*/ - - -/* - &GLOBAL-DEFINE EXCLUDE-Exclude-list FOO - Uncomment this if you do not want to use the file pattern filter, aka Ildefonzo Filter :-) -*/ - - - Modified: trunk/prolint/desktop.w =================================================================== --- trunk/prolint/desktop.w 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/desktop.w 2006-03-13 21:29:41 UTC (rev 259) @@ -41,7 +41,6 @@ /* *************************** Definitions ************************** */ -{prolint/customize.i} {prolint/dlc-version.i} /* Parameters Definitions --- */ Modified: trunk/prolint/filters/exclude.p =================================================================== --- trunk/prolint/filters/exclude.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/filters/exclude.p 2006-03-13 21:29:41 UTC (rev 259) @@ -32,18 +32,14 @@ INDEX idx_1 AS PRIMARY SourceFile RuleID. ON "CLOSE":U OF THIS-PROCEDURE DO: - DELETE PROCEDURE THIS-PROCEDURE. + DELETE PROCEDURE THIS-PROCEDURE. END. - &IF DEFINED( EXCLUDE-Exclude-list )=0 &THEN RUN FillExcludeList. - &ENDIF - RETURN. -&IF DEFINED(EXCLUDE-Exclude-list)=0 &THEN PROCEDURE FillExcludeList : /* purpose: read a list of warnings that you want to exclude. store them in a temp-table for fast retrieval. @@ -58,6 +54,9 @@ DELETE tt_exclude. END. + IF NOT LOGICAL(DYNAMIC-FUNCTION("ProlintProperty", "filters.excludelist")) THEN + RETURN. + /* file format: sourcefile|RuleID1, RuleID2 .... RuleID3 @@ -91,9 +90,7 @@ END. END PROCEDURE. -&ENDIF - PROCEDURE GetFilterResult : /* purpose: this procedure is called from prolint/filterplugins.p just before the Modified: trunk/prolint/filters/filterparams.i =================================================================== --- trunk/prolint/filters/filterparams.i 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/filters/filterparams.i 2006-03-13 21:29:41 UTC (rev 259) @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------ */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} Modified: trunk/prolint/filters/ignoreab.p =================================================================== --- trunk/prolint/filters/ignoreab.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/filters/ignoreab.p 2006-03-13 21:29:41 UTC (rev 259) @@ -24,14 +24,15 @@ {prolint/filters/filterparams.i} +DEFINE VARIABLE IgnoreAppbuilderstuff AS LOGICAL NO-UNDO. +IgnoreAppbuilderstuff = LOGICAL ( DYNAMIC-FUNCTION ("ProlintProperty", "filters.IgnoreAppbuilderstuff")). + ON "CLOSE":U OF THIS-PROCEDURE DO: {prolint/unsubscribe.i} DELETE PROCEDURE THIS-PROCEDURE. END. -&IF DEFINED(EXCLUDE-AppbuilderStuff)=0 &THEN - /* tt_codesection helps suppressing warnings from UIB/AppBuilder-generated code */ DEFINE TEMP-TABLE tt_codesection NO-UNDO FIELD sourcefile AS CHARACTER @@ -62,24 +63,22 @@ RETURN FALSE. /* pLineNumber may be 0 when you are inspecting a synthetic node, FALSE just appears to make a little bit more sense than TRUE */ - &IF DEFINED(EXCLUDE-AppbuilderStuff)>0 &THEN - /* do not ignore AppBuilder stuff.. perhaps because you never use AppBuilder? - don't waste time looking for &ANALYZE_SUSPEND, just assume this line is not AbGenerated.. */ + IF NOT IgnoreAppbuilderstuff THEN RETURN FALSE. - &ELSE + ELSE DO: - /* did we already scan this sourcefile for &ANALYZE_SUSPEND directives? */ - IF NOT CAN-FIND(FIRST tt_codesection WHERE tt_codesection.sourcefile = pSourceFile) THEN - RUN AbFindSections (pSourceFile). + /* did we already scan this sourcefile for &ANALYZE_SUSPEND directives? */ + IF NOT CAN-FIND(FIRST tt_codesection WHERE tt_codesection.sourcefile = pSourceFile) THEN + RUN AbFindSections (pSourceFile). - /* if this line is in a codesection, then it is not AB-generated */ - FIND FIRST tt_codesection WHERE tt_codesection.sourcefile = pSourceFile - AND tt_codesection.firstline <= pLineNumber - AND tt_codesection.lastline >= pLineNumber - NO-ERROR. - RETURN NOT (AVAILABLE tt_codesection). + /* if this line is in a codesection, then it is not AB-generated */ + FIND FIRST tt_codesection WHERE tt_codesection.sourcefile = pSourceFile + AND tt_codesection.firstline <= pLineNumber + AND tt_codesection.lastline >= pLineNumber + NO-ERROR. + RETURN NOT (AVAILABLE tt_codesection). - &ENDIF + END. END FUNCTION. @@ -162,7 +161,6 @@ END. END PROCEDURE. -&ENDIF PROCEDURE GetFilterResult : @@ -183,9 +181,10 @@ IF pIgnoreAB = FALSE THEN RETURN. - &IF DEFINED( EXCLUDE-AppbuilderStuff )=0 &THEN - filtered = IsAbGenerated ( pFullSource, pLineNumber ). - &ENDIF + IF IgnoreAppbuilderstuff THEN + filtered = IsAbGenerated ( pFullSource, pLineNumber ). + ELSE + filtered = FALSE. END PROCEDURE. Modified: trunk/prolint/filters/nowarn.p =================================================================== --- trunk/prolint/filters/nowarn.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/filters/nowarn.p 2006-03-13 21:29:41 UTC (rev 259) @@ -24,7 +24,10 @@ {prolint/filters/filterparams.i} +DEFINE VARIABLE useThisFilter AS LOGICAL NO-UNDO. +useThisFilter = LOGICAL ( DYNAMIC-FUNCTION("ProlintProperty", "filters.nowarnlist")). + DEFINE TEMP-TABLE tt_ignore NO-UNDO FIELD Sourcefile AS CHARACTER FIELD RuleID AS CHARACTER @@ -35,16 +38,13 @@ DELETE PROCEDURE THIS-PROCEDURE. END. -&IF DEFINED(EXCLUDE-Nowarn-list)=0 &THEN -RUN FillIgnoreList (ProfileDirectory). -&ENDIF +IF useThisFilter THEN + RUN FillIgnoreList (ProfileDirectory). RETURN. -&IF DEFINED(EXCLUDE-Nowarn-list)=0 &THEN - PROCEDURE FillIgnoreList : /* purpose: read a list of warnings that you want to ignore. store them in a temp-table for fast retrieval. @@ -134,7 +134,6 @@ END PROCEDURE. -&ENDIF PROCEDURE GetFilterResult : /* purpose: @@ -152,9 +151,13 @@ DEFINE OUTPUT PARAMETER filtered AS LOGICAL NO-UNDO. - filtered = CAN-FIND(tt_ignore WHERE tt_ignore.SourceFile = pRelativeSource - AND tt_ignore.RuleID = pRuleID - AND tt_ignore.LineNumber = pLineNumber). + IF useThisFilter THEN + filtered = CAN-FIND(tt_ignore WHERE tt_ignore.SourceFile = pRelativeSource + AND tt_ignore.RuleID = pRuleID + AND tt_ignore.LineNumber = pLineNumber). + ELSE + filtered = FALSE. + END PROCEDURE. Added: trunk/prolint/help/appbuilder.htxt =================================================================== --- trunk/prolint/help/appbuilder.htxt (rev 0) +++ trunk/prolint/help/appbuilder.htxt 2006-03-13 21:29:41 UTC (rev 259) @@ -0,0 +1,28 @@ + +<h1>Appbuilder integration</h1> + +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. + +<p> + +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: +<pre> + {prolint/ab/custom_evnt.i} +</pre> +You may have to compile...save adecomm/_adeevnt.p and restart +the Appbuilder before the change has effect. + +<p> +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. +<br /> +Notice however that only the <b>saved</b> file will be inspected, not +the version in memory that may be different from the saved version! + + Added: trunk/prolint/help/contact.html =================================================================== --- trunk/prolint/help/contact.html (rev 0) +++ trunk/prolint/help/contact.html 2006-03-13 21:29:41 UTC (rev 259) @@ -0,0 +1,24 @@ +<head> +<title>File Not Found</title> +<STYLE> +BODY {font-family: "Arial"; font-size: 10pt; } +P {font-family: "Arial"; font-size: 10pt; } +H1 {font-size: 20pt; color: 800040; text-align: Left; } +A:hover {color: #ff4444;} +</STYLE> +</head> +<body bgcolor=#FFFFFF> +<H1>Contact information</h1> + +You can email me, but unfortunately I can't write my email address in a clear way, because address harvesters are continuously scanning HTML-pages looking for new victims to send spam to. + +<p> +My email address is: <pre>jurjen at prolint.org</pre> +Of course, you must replace " at ", including the whitespace, by the famous symbol also known as Shift-2. +<p> +Sorry for the inconvenience. + + +</BODY> +</head> + Modified: trunk/prolint/help/customization.menu =================================================================== --- trunk/prolint/help/customization.menu 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/help/customization.menu 2006-03-13 21:29:41 UTC (rev 259) @@ -2,7 +2,6 @@ "run_prolint.htm" "wrapper procedures" "v8pubsub.htm" "Publish/Subscribe in Progress 8" "newrule.htm" "how to create a new rule" -"http://twiki.prolint.org/SnippetIndex" "Some code snippets, commonly used in rules" "customrule.htm" "how to create a custom rule" "outputhandler.htm" "how to create a new outputhandler" "regrtest.htm" "regression testing" Modified: trunk/prolint/help/integrations.menu =================================================================== --- trunk/prolint/help/integrations.menu 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/help/integrations.menu 2006-03-13 21:29:41 UTC (rev 259) @@ -1,3 +1,4 @@ +"appbuilder.htm" "Appbuilder integration" "roundtable.htm" "Roundtable integration" "check-in.htm" "Roundtable check-in validation" "config.htm" "configure Roundtable check-in validation" Modified: trunk/prolint/help/newrule.htxt =================================================================== --- trunk/prolint/help/newrule.htxt 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/help/newrule.htxt 2006-03-13 21:29:41 UTC (rev 259) @@ -82,13 +82,7 @@ </ol> <h2>Progress 8-9 compatibility issues</h2> -Do not use PUBLISH or SUBSCRIBE keywords. Rules don't usually PUBLISH anything but if you have to, please consider the -{prolint/v8pubsub.i} and {prolint/publish.i} files, see page <a href="v8pubsub.htm">Publish/Subscribe in Progress 8</a>. -<p> -Even though lintsuper.p is loaded as a super-procedure to every rule in Progress 9, please be aware that Progress 8 -doesn't know the concept of super-procs. So please use "RUN procname {&insuper}". -<br> -{&insuper} is defined as blank in Progress 9 and as "IN hLintSuper" in Progress 8. -<p> -If you are running Progress 9 you can test the behavior of {&insuper} : -just add "&GLOBAL-DEFINE EXCLUDE-superprocedure" to the bottom of file "prolint/customize.i" and run to see if all still works. + +Prolint release 63 runs in Progress 8 and in Progress 9. Prolint release 64 (and up) does not run in Progress 8 anymore. + + Modified: trunk/prolint/help/opensource.htxt =================================================================== --- trunk/prolint/help/opensource.htxt 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/help/opensource.htxt 2006-03-13 21:29:41 UTC (rev 259) @@ -23,9 +23,10 @@ <br /> So there is a bulletin board and there is an e-mail list. Both have their merits; the advantage of a bulletin board is that topics are organized in categories while an e-mail list is usually sorted by DateTime. -<h2>CVS Repository</h2> -The sources for Prolint are maintained in a CVS tree at sourceforge.net. If you have programmed something you would -like to share, you can sign up as developer at sourceforge and commit your sources directly to the CVS repository. +<h2>Sources and Version Control</h2> +The sources for Prolint are maintained in a Subversion repository at sourceforge.net. If you have programmed something you would +like to share, you can sign up as developer at sourceforge and commit +your sources directly to the Subversion repository. Alternatively, you can attach your modifications in an email to <a href="contact.htm">me</a> <br>I will then integrate it in Prolint, post the new sources to http://www.prolint.org and announce it to pro...@pe.... Modified: trunk/prolint/help/release.ini =================================================================== --- trunk/prolint/help/release.ini 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/help/release.ini 2006-03-13 21:29:41 UTC (rev 259) @@ -1,2 +1,2 @@ [current] -prolint=63 +prolint=64 Modified: trunk/prolint/help/turbolint.htxt =================================================================== --- trunk/prolint/help/turbolint.htxt 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/help/turbolint.htxt 2006-03-13 21:29:41 UTC (rev 259) @@ -20,12 +20,16 @@ <a href="customrule.htm">custom rules</a> allways take precendence over standard rules. If you are modifying an existing rule it makes sense to copy it from directory "prolint/rules" to "prolint/custom/rules". Don't forget to also list the custom rule in file "prolint/custom/rules/rules.d". <p> -If you don't want to make a custom rule, but still want to run a 4GL rule instead of a 3GL rule, then you can specify so in file "prolint/customize.i" : <br> +If you don't want to make a custom rule, but still want to run a 4GL +rule instead of a 3GL rule, then you can specify so in file +"prolint/custom/prolint.properties.p" : <br> For example: <pre> -&GLOBAL-DEFINE Turbolint_IgnoreRules noundo,varusage + RUN SetProlintProperty ("Turbolint.RulesToIgnore", "noundo,varusage"). </pre> -will force Turbolint to NOT run its built-in versions of rule "noundo" and "varusage", and Prolint will run the 4GL versions instead. +will force Turbolint to NOT run its built-in versions of rule "noundo" +and "varusage", and Prolint will run the 4GL versions instead. See +file prolint/prolint.properties.p for more details. <p> Finally, you can simply remove or rename file "prolint/turbolint.dll" so Prolint cannot find it. Prolint will then simply fall back to its 4GL rules. <p> Modified: trunk/prolint/lintcfg.w =================================================================== --- trunk/prolint/lintcfg.w 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/lintcfg.w 2006-03-13 21:29:41 UTC (rev 259) @@ -54,7 +54,6 @@ CREATE WIDGET-POOL. /* *************************** Definitions ************************** */ -{prolint/customize.i} {prolint/dlc-version.i} /* Parameters Definitions --- */ Modified: trunk/prolint/lintsuper.p =================================================================== --- trunk/prolint/lintsuper.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/lintsuper.p 2006-03-13 21:29:41 UTC (rev 259) @@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------ */ -/* customize.i allows to switch some features on/off */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} Modified: trunk/prolint/outputhandlers/PRO4mfile.p =================================================================== --- trunk/prolint/outputhandlers/PRO4mfile.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/PRO4mfile.p 2006-03-13 21:29:41 UTC (rev 259) @@ -5,7 +5,6 @@ You can also import easily in Excel by : Jurjen Dijkstra & Yuriy Setrko (PRO4m adjustment) ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} Modified: trunk/prolint/outputhandlers/dlgfilter.w =================================================================== --- trunk/prolint/outputhandlers/dlgfilter.w 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/dlgfilter.w 2006-03-13 21:29:41 UTC (rev 259) @@ -39,7 +39,6 @@ ----------------------------------------------------------------------- */ /* *************************** Definitions ************************** */ -{prolint/customize.i} {prolint/dlc-version.i} Modified: trunk/prolint/outputhandlers/ed4win.p =================================================================== --- trunk/prolint/outputhandlers/ed4win.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/ed4win.p 2006-03-13 21:29:41 UTC (rev 259) @@ -24,7 +24,6 @@ License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} Modified: trunk/prolint/outputhandlers/logexcel.p =================================================================== --- trunk/prolint/outputhandlers/logexcel.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/logexcel.p 2006-03-13 21:29:41 UTC (rev 259) @@ -22,7 +22,6 @@ License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ====================================================================== */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} @@ -48,7 +47,8 @@ END. ELSE DO: chExcel:VISIBLE = TRUE. - logfile = subst("&1prolint&2.xml", session:temp-directory, replace(string(time, "hh:mm:ss"), ":", "")). + logfile = substitute("&1prolint&2.xml", DYNAMIC-FUNCTION("ProlintProperty", "outputhandlers.outputdirectory"), + replace(string(time, "hh:mm:ss"), ":", "")). OUTPUT TO VALUE(logfile). PUT UNFORMATTED Modified: trunk/prolint/outputhandlers/logfile.p =================================================================== --- trunk/prolint/outputhandlers/logfile.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/logfile.p 2006-03-13 21:29:41 UTC (rev 259) @@ -22,16 +22,17 @@ License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} -DEFINE VARIABLE logfile AS CHAR NO-UNDO INITIAL "prolint.log":U. +DEFINE VARIABLE logfile AS CHAR NO-UNDO. {prolint/subscribe.i "Prolint_InitializeResults"} {prolint/subscribe.i "Prolint_AddResult"} {prolint/subscribe.i "Prolint_FinalizeResults"} - + +logfile = SUBSTITUTE("&1prolint.log", DYNAMIC-FUNCTION("ProlintProperty", "outputhandlers.outputdirectory")). + RETURN. Modified: trunk/prolint/outputhandlers/logwin.w =================================================================== --- trunk/prolint/outputhandlers/logwin.w 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/logwin.w 2006-03-13 21:29:41 UTC (rev 259) @@ -73,7 +73,6 @@ /* Local Variable Definitions --- */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} @@ -872,10 +871,8 @@ {prolint/subscribe.i "Prolint_Status_Profile"} {prolint/subscribe.i "Prolint_Status_Progress"} - &IF DEFINED(EXCLUDE-Status-timer)=0 &THEN - {prolint/subscribe.i "Prolint_Status_StartTimer"} - {prolint/subscribe.i "Prolint_Status_StopTimer"} - &ENDIF + {prolint/subscribe.i "Prolint_Status_StartTimer"} + {prolint/subscribe.i "Prolint_Status_StopTimer"} SUBSCRIBE TO "Prolint_SendLogWin_Ed4Win":U ANYWHERE. @@ -1985,17 +1982,14 @@ END PROCEDURE. -&IF DEFINED(EXCLUDE-Status-timer)=0 &THEN +PROCEDURE Prolint_Status_StartTimer : + starttime = ETIME(NO). +END PROCEDURE. - PROCEDURE Prolint_Status_StartTimer : - starttime = ETIME(NO). - END PROCEDURE. - - PROCEDURE Prolint_Status_StopTimer : - elapsedtime = ETIME(NO) - starttime. - END PROCEDURE. +PROCEDURE Prolint_Status_StopTimer : + elapsedtime = ETIME(NO) - starttime. +END PROCEDURE. -&ENDIF /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME Modified: trunk/prolint/outputhandlers/logwin8.w =================================================================== --- trunk/prolint/outputhandlers/logwin8.w 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/logwin8.w 2006-03-13 21:29:41 UTC (rev 259) @@ -45,7 +45,6 @@ /* Local Variable Definitions --- */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} @@ -741,10 +740,8 @@ {prolint/subscribe.i "Prolint_Status_Profile"} {prolint/subscribe.i "Prolint_Status_Progress"} - &IF DEFINED(EXCLUDE-Status-timer)=0 &THEN - {prolint/subscribe.i "Prolint_Status_StartTimer"} - {prolint/subscribe.i "Prolint_Status_StopTimer"} - &ENDIF + {prolint/subscribe.i "Prolint_Status_StartTimer"} + {prolint/subscribe.i "Prolint_Status_StopTimer"} &IF {&dlc-version}>8 &THEN SUBSCRIBE TO "Prolint_SendLogWin_Ed4Win":U ANYWHERE. @@ -1124,17 +1121,14 @@ END PROCEDURE. -&IF DEFINED(EXCLUDE-Status-timer)=0 &THEN +PROCEDURE Prolint_Status_StartTimer : + starttime = ETIME(NO). +END PROCEDURE. - PROCEDURE Prolint_Status_StartTimer : - starttime = ETIME(NO). - END PROCEDURE. - - PROCEDURE Prolint_Status_StopTimer : - elapsedtime = ETIME(NO) - starttime. - END PROCEDURE. +PROCEDURE Prolint_Status_StopTimer : + elapsedtime = ETIME(NO) - starttime. +END PROCEDURE. -&ENDIF /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME Modified: trunk/prolint/outputhandlers/prolintdb.p =================================================================== --- trunk/prolint/outputhandlers/prolintdb.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/prolintdb.p 2006-03-13 21:29:41 UTC (rev 259) @@ -23,7 +23,6 @@ License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} Modified: trunk/prolint/outputhandlers/regrlog.p =================================================================== --- trunk/prolint/outputhandlers/regrlog.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/regrlog.p 2006-03-13 21:29:41 UTC (rev 259) @@ -23,7 +23,6 @@ License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} Modified: trunk/prolint/outputhandlers/showhtml.p =================================================================== --- trunk/prolint/outputhandlers/showhtml.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/showhtml.p 2006-03-13 21:29:41 UTC (rev 259) @@ -22,13 +22,18 @@ License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} -DEFINE VARIABLE logfile AS CHAR NO-UNDO INITIAL "lint_results.htm":U. +DEFINE VARIABLE logfile AS CHAR NO-UNDO. DEFINE VARIABLE oddrow AS LOGICAL NO-UNDO. +DEFINE VARIABLE prolint_url AS CHAR NO-UNDO. +logfile = SUBSTITUTE("&1&2lint_result.html", DYNAMIC-FUNCTION("ProlintProperty", "outputhandlers.outputdirectory"), + DYNAMIC-FUNCTION("ProlintProperty", "logincode")). + +prolint_url = DYNAMIC-FUNCTION("ProlintProperty", "url to help/rules"). + /* cache helpfile locations */ DEFINE TEMP-TABLE tt_help NO-UNDO FIELD ruleid AS CHARACTER @@ -46,22 +51,9 @@ FUNCTION helpfile RETURNS CHARACTER (pRuleid AS CHARACTER) : /* purpose: find url to helpfile of pRuleid. Use a temp-table to cache results for performance */ - FIND tt_help WHERE tt_help.ruleid = pRuleId NO-ERROR. - IF AVAILABLE tt_help THEN - RETURN tt_help.url. - - FILE-INFO:FILE-NAME = "prolint/help/rules/":U + pRuleId + ".htm":U. - IF FILE-INFO:FULL-PATHNAME <> ? THEN DO: - CREATE tt_help. - ASSIGN tt_help.ruleid = pRuleId - tt_help.url = FILE-INFO:FULL-PATHNAME. - END. - - IF AVAILABLE tt_help THEN - RETURN tt_help.url. - ELSE - RETURN "". - + + RETURN prolint_url + "/":U + pRuleId + ".htm":U. + END FUNCTION. PROCEDURE Prolint_InitializeResults : @@ -160,17 +152,11 @@ /* don't use closing tags like </body></html> so you can append to it later. most browsers don't care much about these closing tags */ - /* (try to) show the htm file in your default browser. Wonder what happens in Unix. */ - /* stupid OS-COMMAND doesn't show the fresh page if the browser is already open, - ShellExecute would be better but there is a demand for platform compatibility */ DEFINE VARIABLE fullname AS CHARACTER NO-UNDO. FILE-INFO:FILE-NAME = logfile. fullname = FILE-INFO:FULL-PATHNAME. - IF fullname NE ? THEN - IF OS-GETENV("os":U) = "Windows_NT":U THEN - OS-COMMAND NO-WAIT VALUE(fullname). - ELSE - OS-COMMAND NO-WAIT START VALUE(fullname). + IF fullname NE ? THEN + RUN prolint/openhtml.p (fullname). /* This procedure will not be invoked again, so it can exit */ {prolint/unsubscribe.i} @@ -178,3 +164,4 @@ END PROCEDURE. + Modified: trunk/prolint/outputhandlers/tabfile.p =================================================================== --- trunk/prolint/outputhandlers/tabfile.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/outputhandlers/tabfile.p 2006-03-13 21:29:41 UTC (rev 259) @@ -24,14 +24,16 @@ License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} -DEFINE VARIABLE logfile AS CHARACTER NO-UNDO INITIAL "prolint.tab":U. +DEFINE VARIABLE logfile AS CHARACTER NO-UNDO. DEFINE VARIABLE delim AS CHARACTER NO-UNDO. delim = CHR(9). /* tab */ - + +logfile = SUBSTITUTE("&1&2prolint.tab", DYNAMIC-FUNCTION("ProlintProperty", "outputhandlers.outputdirectory"), + DYNAMIC-FUNCTION("ProlintProperty", "logincode")). + {prolint/subscribe.i "Prolint_InitializeResults"} {prolint/subscribe.i "Prolint_AddResult"} {prolint/subscribe.i "Prolint_FinalizeResults"} Modified: trunk/prolint/prolint.p =================================================================== --- trunk/prolint/prolint.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/prolint.p 2006-03-13 21:29:41 UTC (rev 259) @@ -28,9 +28,7 @@ similar to bugfix 1.0d04 */ &SCOPED-DEFINE ProparseVersion "2.2b01":U -/* customize.i allows to switch some features on/off */ -{prolint/customize.i} -{prolint/dlc-version.i} +{prolint/dlc-version.i} {prolint/v8pubsub.i} DEFINE INPUT PARAMETER pSourcefile AS CHARACTER NO-UNDO. /* a single filename to lint */ @@ -61,6 +59,7 @@ DEFINE VARIABLE tmpTurbolintNowarn AS CHARACTER NO-UNDO. /* tempfile where turbolint.dll writes nowarn-lines to */ DEFINE VARIABLE hTurbolint AS INTEGER NO-UNDO. /* hInstance of turbolint.dll */ DEFINE VARIABLE hpFilterPlugins AS HANDLE NO-UNDO. +DEFINE VARIABLE hpProperties AS HANDLE NO-UNDO. {proparse/api/proparse.i hparser} @@ -88,6 +87,8 @@ FIELD sourcefile AS CHARACTER INDEX idx_sourcefile AS PRIMARY UNIQUE sourcefile. + RUN prolint/propsuper.p PERSISTENT SET hpProperties. + /* make sure hParser is invalid. We will use function VALID-HANDLE() later, in GetProparseHandle */ ASSIGN hParser = ?. @@ -117,6 +118,7 @@ MESSAGE "prolint: no valid outputhandlers specified":U VIEW-AS ALERT-BOX. {prolint/unsubscribe.i} RUN DeleteTempdir. + DELETE PROCEDURE hpProperties. RETURN. END. @@ -136,6 +138,7 @@ {prolint/publish.i "Prolint_FinalizeResults"} {prolint/unsubscribe.i} RUN DeleteTempdir. + DELETE PROCEDURE hpProperties. RETURN STRING(MaxSeverity). END. @@ -202,6 +205,7 @@ {prolint/unsubscribe.i} IF hTurbolint<>0 THEN RUN FreeLibrary (hTurbolint). + DELETE PROCEDURE hpProperties. /* stop hourglass cursor */ RUN set-hourglass(FALSE). @@ -402,7 +406,7 @@ DEFINE VARIABLE handler AS CHARACTER NO-UNDO. DEFINE VARIABLE i AS INTEGER NO-UNDO. DEFINE VARIABLE hw AS HANDLE NO-UNDO. - + /* import list of outputhandlers */ FILE-INFO:FILE-NAME = "prolint/outputhandlers/choices.d":U. IF FILE-INFO:FULL-PATHNAME <> ? THEN DO: @@ -451,16 +455,17 @@ LogwinRunning = TRUE. hw = hw:NEXT-SIBLING. END. - IF NOT LogwinRunning THEN + IF NOT LogwinRunning THEN DO: &IF {&dlc-version}=8 &THEN RUN prolint/outputhandlers/logwin8.w PERSISTENT. &ELSE RUN prolint/outputhandlers/logwin.w PERSISTENT. &ENDIF + END. END. OTHERWISE RUN VALUE("prolint/outputhandlers/":U + handler) PERSISTENT. - END. + END. END. {prolint/publish_log.i "Prolint_InitializeResults" pClearOutput} @@ -503,11 +508,7 @@ /* enable reading of PROPARSE-DIRECTIVE for Prolint pragma's */ IF VALID-HANDLE(hParser) THEN - &IF DEFINED(EXCLUDE-SupportPragmas)=0 &THEN parserConfigSet("show-proparse-directives":U, "true":U). - &ELSE - parserConfigSet("show-proparse-directives":U, "false":U). - &ENDIF /* define database aliases: */ RUN DefineAliases. @@ -679,13 +680,9 @@ p-SourceFile = FILE-INFO:FULL-PATHNAME. /* PreAnalyze creates compile listing, XREF file, token tree in proparse.dll, ... */ - &IF DEFINED(EXCLUDE-Status-timer)=0 &THEN - {prolint/publish.i "Prolint_Status_StopTimer"} - &ENDIF + {prolint/publish.i "Prolint_Status_StopTimer"} RUN PreAnalyze(p-SourceFile, OUTPUT ErrorMessage). - &IF DEFINED(EXCLUDE-Status-timer)=0 &THEN - {prolint/publish.i "Prolint_Status_StartTimer"} - &ENDIF + {prolint/publish.i "Prolint_Status_StartTimer"} IF ErrorMessage="":U THEN DO: IF hTurbolint<>0 THEN DO: @@ -814,12 +811,10 @@ ELSE DO: ASSIGN topnode = parserGetHandle(). /* note: must be assigned after parserParse() */ parserNodeTop(topnode). /* this gets us the "Program_root" node */ - &IF DEFINED(EXCLUDE-SupportPragmas)=0 &THEN IF hTurbolint=0 THEN /* (turbolint.dll has a faster copy of FindProparseDirectives) */ RUN FindProparseDirectives. - &ENDIF - IF NeedProclist THEN + IF NeedProclist THEN RUN BuildProcedureList. /* Run the tree parser for added node attributes */ @@ -837,7 +832,6 @@ END PROCEDURE. -&IF DEFINED(EXCLUDE-SupportPragmas)=0 &THEN FUNCTION ParseProparseDirectives RETURNS CHARACTER (ipNode AS INTEGER, ipPragmaText AS CHARACTER) : /* purpose : when a proparse directive is found, return a list of rules that it is supposed to suppress warnings for. @@ -882,10 +876,8 @@ RETURN TRIM(ReturnValue,',':U). END FUNCTION. -&ENDIF - -&IF DEFINED(EXCLUDE-SupportPragmas)=0 &THEN + PROCEDURE FindProparseDirectives : /* purpose : proparse directives are used for suppressing Prolint warnings. find every directive, mark the statement following the directive with attributes. @@ -917,10 +909,8 @@ parserReleaseHandle(grandchild). END PROCEDURE. -&ENDIF - -&IF DEFINED(EXCLUDE-SupportPragmas)=0 &THEN + PROCEDURE DecorateTree : /* purpose : DecorateTree marks the statement following a proparse-directive. all nodes in the statement have to be marked, because a query might @@ -967,7 +957,6 @@ parserReleaseHandle(child). END PROCEDURE. -&ENDIF PROCEDURE BuildProcedureList : @@ -1241,7 +1230,10 @@ DEFINE VARIABLE keywordlistfile AS CHARACTER NO-UNDO. DEFINE VARIABLE IgnoreABlist AS CHARACTER NO-UNDO. DEFINE VARIABLE noProparseRules AS CHARACTER NO-UNDO. + DEFINE VARIABLE IgnoreTurboRules AS CHARACTER NO-UNDO. + IgnoreTurboRules = DYNAMIC-FUNCTION("ProlintProperty", "Turbolint.RulesToIgnore"). + IF OPSYS <> "WIN32":U THEN RETURN. FILE-INFO:FILE-NAME = "prolint/turbolint/turbolint.dll":U. @@ -1265,7 +1257,7 @@ /* ... Too late, you missed your opportunity to override RulesInDLL :-) Now, mark tt_rules to disable 4GL rules: */ FOR EACH tt_rules WHERE tt_rules.custom=FALSE : - IF LOOKUP(tt_rules.ruleid, RulesInDLL)>0 AND LOOKUP(tt_rules.ruleid, "{&Turbolint_IgnoreRules}":U)=0 THEN + IF LOOKUP(tt_rules.ruleid, RulesInDLL)>0 AND LOOKUP(tt_rules.ruleid, IgnoreTurboRules)=0 THEN tt_rules.byturbolint = TRUE. END. Added: trunk/prolint/prolint.properties.p =================================================================== --- trunk/prolint/prolint.properties.p (rev 0) +++ trunk/prolint/prolint.properties.p 2006-03-13 21:29:41 UTC (rev 259) @@ -0,0 +1,105 @@ +/* ------------------------------------------------------------------ + file : prolint/prolint.properties.p + purpose : set default properties for Prolint, rules, outputhandlers etc + ----------------------------------------------------------------- + + Copyright (C) 2006 Jurjen Dijkstra + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ------------------------------------------------------------------ */ + + + /* + >>>> DO NOT MODIFY THIS FILE! <<<< + + Instead, create a copy of this procedure file + and place it in directory: + prolint/custom + so you get a file named: + prolint/custom/prolint.properties.p + + Then modify the contents of prolint/custom/prolint.properties.p. + You can change existing properties and you can add new ones too. + + It is recommended to delete lines from prolint/custom/prolint.properties.p + for properties that you do NOT want to change. In other words: file + prolint/custom/prolint.properties.p should ONLY contain MODIFIED properties! + + An other way of saying it: + create an empty file named prolint/custom/prolint.properties.p + and then add the properties to it that you want to change. + + */ + + + /* "outputhandlers.outputdirectory" + the directory where outputhandlers save their outputfiles */ + RUN SetProlintProperty ("outputhandlers.outputdirectory", SESSION:TEMP-DIR). + + + /* "logincode" + some outputhandlers prepend logincode to their outputfile, which is convenient when + several users access the same outputdirectory at the same time */ + IF CONNECTED("dictdb") AND USERID("dictdb")>"" THEN + RUN SetProlintProperty ("logincode", USERID("dictdb")). + ELSE + RUN SetProlintProperty ("logincode", ""). + + + /* "url to help/rules" + specifies how to open a helpfile for a rule, using the web browser */ + FILE-INFO:FILE-NAME= "prolint/help/rules". + RUN SetProlintProperty ("url to help/rules", FILE-INFO:FULL-PATHNAME). + + + /* "filters.excludelist" + use filters/exclude.p or not? */ + RUN SetProlintProperty ("filters.excludelist", STRING( TRUE )). + + + /* "filters.nowarnlist" + TRUE: use filters/nowarn.p + FALSE: do not use filter/nowarn.p */ + RUN SetProlintProperty ("filters.nowarnlist", STRING( TRUE )). + + + /* "filters.Appbuilderstuff" + if TRUE then try to ignore warnings caused from AB-generated code */ + RUN SetProlintProperty ("filters.IgnoreAppbuilderstuff", STRING( TRUE )). + + + /* "rules.varusage.OutputParamsAreUsed" + customization for rule "varusage": + if TRUE, output parameters are always considered to be "used" and will not cause a warning. + if FALSE, output parameters are considered to be "not used" unless they are explicitly assigned */ + RUN SetProlintProperty ("rules.varusage.OutputParamsAreUsed", STRING( TRUE )). + + + /* "rules.RemoveLogicalDatabaseName" + if FALSE, don't remove the ldbname from tablename (send "sports.customer" to outputhandler) + if TRUE, remove the ldbname from tablename (send "customer" to outputhandler) */ + RUN SetProlintProperty ("rules.RemoveLogicalDatabaseName", STRING( TRUE )). + + + /* "TurboLint.RulesToIgnore" + IF turbolint contains a 3GL version of a rule but you prefer to run the 4GL version, + add the name of the rule to this comma-separated list. + For example, to use the 4GL versions of "noundo" and "varusage" : + RUN SetProlintProperty ("Turbolint.RulesToIgnore", "noundo,varusage"). */ + RUN SetProlintProperty ("Turbolint.RulesToIgnore", ""). + + Added: trunk/prolint/propsuper.p =================================================================== --- trunk/prolint/propsuper.p (rev 0) +++ trunk/prolint/propsuper.p 2006-03-13 21:29:41 UTC (rev 259) @@ -0,0 +1,76 @@ +/* ======================================================================= + file : prolint/propsuper.p + purpose : manage Prolint properties + by : Jurjen Dijkstra + ----------------------------------------------------------------- + + Copyright (C) 2006 Jurjen Dijkstra + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ====================================================================== */ + + /* this procedure is temporarily session:super so every Prolint program can call it */ + SESSION:ADD-SUPER-PROCEDURE (THIS-PROCEDURE). + + DEFINE TEMP-TABLE tt_prop NO-UNDO + FIELD property AS CHARACTER + FIELD stringvalue AS CHARACTER + INDEX idx_prop AS PRIMARY UNIQUE property. + + /* fetch default properties */ + RUN prolint/prolint.properties.p. + + /* fetch custom properties, if they exist */ + IF SEARCH("prolint/custom/prolint.properties.p")<>? THEN + RUN prolint/custom/prolint.properties.p. + + + /* repair a few properties, if necessary: */ + + /* 1. outputdirectory must end with a slash */ + FIND tt_prop WHERE tt_prop.property = "outputhandlers.outputdirectory" NO-ERROR. + IF AVAILABLE tt_prop THEN + IF tt_prop.stringvalue > "" THEN + IF NOT ((SUBSTRING(tt_prop.stringvalue, LENGTH(tt_prop.stringvalue,"CHARACTER":U)) = '~\':U) OR (SUBSTRING(tt_prop.stringvalue, LENGTH(tt_prop.stringvalue,"CHARACTER":U)) = '/':U)) THEN + tt_prop.stringvalue = tt_prop.stringvalue + '/':U. + + +/* this procedure is called from prolint.properties.p : */ +PROCEDURE SetProlintProperty : + DEFINE INPUT PARAMETER property AS CHARACTER NO-UNDO. + DEFINE INPUT PARAMETER propvalue AS CHARACTER NO-UNDO. + + FIND tt_prop WHERE tt_prop.property = property NO-ERROR. + IF NOT AVAILABLE tt_prop THEN CREATE tt_prop. + ASSIGN tt_prop.property = property + tt_prop.stringvalue = propvalue. + +END PROCEDURE. + + +/* this function is called from wherever you want to read a property: */ +FUNCTION ProlintProperty RETURNS CHARACTER (INPUT property AS CHARACTER) : + + FIND tt_prop WHERE tt_prop.property = property NO-ERROR. + IF AVAILABLE tt_prop THEN + RETURN tt_prop.stringvalue. + ELSE + RETURN "". + +END FUNCTION. + + Modified: trunk/prolint/rtb/checkin-handler.p =================================================================== --- trunk/prolint/rtb/checkin-handler.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/rtb/checkin-handler.p 2006-03-13 21:29:41 UTC (rev 259) @@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ======================================================================================= */ -{prolint/customize.i} {prolint/dlc-version.i} {prolint/v8pubsub.i} {rtb/g/rtbglobl.i} Modified: trunk/prolint/ruleparams.i =================================================================== --- trunk/prolint/ruleparams.i 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/ruleparams.i 2006-03-13 21:29:41 UTC (rev 259) @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------ */ -{prolint/customize.i} {prolint/dlc-version.i} {&_proparse_ prolint-nowarn(varusage)} @@ -41,10 +40,9 @@ {&_proparse_ prolint-nowarn(varusage)} DEFINE INPUT PARAMETER hpRulePersist AS HANDLE NO-UNDO. /* handle to persistent "rules/persist/[rule_id].p" */ -&IF DEFINED(EXCLUDE-AppbuilderStuff)>0 &THEN +IF LOGICAL(DYNAMIC-FUNCTION("ProlintProperty", "filters.IgnoreAppbuilderstuff"))=FALSE THEN IgnoreAB = FALSE. -&ENDIF - + /* use hLintSuper as super-procedure or as normal procedure? */ &IF DEFINED(EXCLUDE-superprocedure)=0 &THEN &GLOBAL-DEFINE insuper Modified: trunk/prolint/rules/ifindent.p =================================================================== --- trunk/prolint/rules/ifindent.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/rules/ifindent.p 2006-03-13 21:29:41 UTC (rev 259) @@ -46,6 +46,8 @@ {prolint/ruleparams.i} +DEFINE VARIABLE IgnoreAppbuilderstuff AS LOGICAL NO-UNDO. +IgnoreAppbuilderstuff = LOGICAL ( DYNAMIC-FUNCTION ("ProlintProperty", "filters.IgnoreAppbuilderstuff")). /* This variable stays the same through all runs of the rule. */ DEFINE VARIABLE warnings AS CHARACTER INITIAL "Both" NO-UNDO. @@ -117,20 +119,14 @@ * check will be done later in PublishResult if we're actually going to give * a warning. */ - &IF DEFINED(EXCLUDE-AppbuilderStuff)=0 &THEN - /* sorry, name of preprocesor is misleading, see prolint/customize.i */ - /* suppress warnings from UIB/AB-generated code, for some rules */ - IF IgnoreAB THEN DO: - ASSIGN nodefilename = RelativeFilename(parserGetNodeFilename(ifNode)). - IF (nodefilename MATCHES "src/adm/*~~.i":U) - OR (nodefilename MATCHES "src/adm2/*~~.i":U) THEN RETURN. - END. - &ENDIF - + IF IgnoreAppbuilderstuff THEN + IF IgnoreAB THEN DO: + ASSIGN nodefilename = RelativeFilename(parserGetNodeFilename(ifNode)). + IF (nodefilename MATCHES "src/adm/*~~.i":U) + OR (nodefilename MATCHES "src/adm2/*~~.i":U) THEN RETURN. + END. - - /* First, calculate IF's indent. If the IF is an ELSE IF, * use the ELSE's indent as the IF's indent. */ Modified: trunk/prolint/rules/message.p =================================================================== --- trunk/prolint/rules/message.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/rules/message.p 2006-03-13 21:29:41 UTC (rev 259) @@ -26,16 +26,20 @@ {prolint/ruleparams.i} +DEFINE VARIABLE IgnoreAppbuilderstuff AS LOGICAL NO-UNDO. + +IgnoreAppbuilderstuff = LOGICAL ( DYNAMIC-FUNCTION ("ProlintProperty", "filters.IgnoreAppbuilderstuff")). + DEFINE TEMP-TABLE tt_abgenerated NO-UNDO FIELD msg AS CHARACTER. -&IF DEFINED(EXCLUDE-AppbuilderStuff)=0 &THEN +IF IgnoreAppbuilderstuff THEN DO: /* create a tt_abgenerated record for each message that is generated by AB/UIB */ CREATE tt_abgenerated. ASSIGN tt_abgenerated.msg = '"*~~.wrx":U':U. CREATE tt_abgenerated. ASSIGN tt_abgenerated.msg = '"* should only be RUN PERSISTENT.":U':U. -&ENDIF +END. RUN searchNode {&insuper} (hTopnode, /* "Program_root" node */ "InspectNode":U, /* name of callback procedure */ @@ -62,14 +66,13 @@ nodefilename = RelativeFilename(parserGetNodeFilename(theNode)). IF (nodefilename MATCHES "src/adm/*~~.i":U) OR (nodefilename MATCHES "src/adm2/*~~.i":U) THEN abgenerated = TRUE. - &IF DEFINED(EXCLUDE-AppbuilderStuff)=0 &THEN ELSE - /* First child is "Form_item", second child might be the "QSTRING" that we are after. */ - IF parserNodeFirstChild(theNode,child)<>"" AND parserNodeFirstChild(child,child)<>"" THEN + IF IgnoreAppbuilderstuff THEN + /* First child is "Form_item", second child might be the "QSTRING" that we are after. */ + IF parserNodeFirstChild(theNode,child)<>"" AND parserNodeFirstChild(child,child)<>"" THEN IF CAN-FIND(FIRST tt_abgenerated WHERE parserGetNodeText(child) MATCHES tt_abgenerated.msg) THEN abgenerated = TRUE. - &ENDIF - + IF (NOT abgenerated) THEN RUN PublishResult {&insuper} (compilationunit, nodefilename, Modified: trunk/prolint/rules/sortaccess.p =================================================================== --- trunk/prolint/rules/sortaccess.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/rules/sortaccess.p 2006-03-13 21:29:41 UTC (rev 259) @@ -31,7 +31,9 @@ DEFINE VARIABLE vOperation AS CHARACTER NO-UNDO. DEFINE VARIABLE vTable AS CHARACTER NO-UNDO. DEFINE VARIABLE vDb AS CHARACTER NO-UNDO. + DEFINE VARIABLE StripLdbName AS LOGICAL NO-UNDO. + StripLdbName = LOGICAL (DYNAMIC-FUNCTION ("ProlintProperty", "rules.RemoveLogicalDatabaseName")). INPUT STREAM xrf FROM VALUE (xreffile). DO WHILE TRUE : @@ -56,10 +58,8 @@ vDb = "". IF NUM-ENTRIES(vTable, '.':U)=2 THEN DO: vDb = ENTRY(1, vTable, '.':U). - &IF DEFINED(EXCLUDE-remove-ldbname)=0 &THEN - /* strip ldbname from tablename. Use prolint/customize.i to suppress this */ - vTable = ENTRY(2, vTable, '.':U). - &ENDIF + IF StripLdbName THEN + vTable = ENTRY(2, vTable, '.':U). END. IF vDB NE "" THEN /* because vDb="" means that vTable is a temp-table */ Modified: trunk/prolint/rules/strattrib.p =================================================================== --- trunk/prolint/rules/strattrib.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/rules/strattrib.p 2006-03-13 21:29:41 UTC (rev 259) @@ -25,6 +25,10 @@ {prolint/ruleparams.i} +DEFINE VARIABLE IgnoreAppbuilderstuff AS LOGICAL NO-UNDO. + +IgnoreAppbuilderstuff = LOGICAL ( DYNAMIC-FUNCTION ("ProlintProperty", "filters.IgnoreAppbuilderstuff")). + RUN IgnoreMenus. RUN searchNode {&insuper} (hTopnode, /* "Program_root" node */ @@ -124,13 +128,12 @@ IF LENGTH(SUBSTRING(theString,2,R-INDEX(theString,quote) - 2),"RAW":U)=0 THEN RETURN. - &IF DEFINED(EXCLUDE-AppbuilderStuff)=0 &THEN + IF IgnoreAppbuilderstuff THEN /* ignore strings in read-only sections created by AppBuilder: */ IF (theString='"The binary control file could not be found. The controls cannot be loaded."':U OR theString='"Controls Not Loaded"':U) THEN RETURN. - &ENDIF /* attribute can be made up of two parts: attJustif - alpha.characters specifying the justification (:L :T :R :C) Modified: trunk/prolint/rules/varusage.p =================================================================== --- trunk/prolint/rules/varusage.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/rules/varusage.p 2006-03-13 21:29:41 UTC (rev 259) @@ -245,13 +245,14 @@ end. /* If not used, then report the object as "never used". */ + DEFINE VARIABLE OutputParamsAreUsed AS LOGICAL NO-UNDO. + OutputParamsAreUsed = LOGICAL(DYNAMIC-FUNCTION("ProlintProperty", "rules.varusage.OutputParamsAreUsed")). for each tt_object where tt_object.IsUsed=FALSE - &IF {&varusage_OutputParamsAreUsed} &THEN - and (not tt_object.ParamType matches "*OUTPUT":U) - &ENDIF : - + and (not (OutputParamsAreUsed AND tt_object.ParamType matches "*OUTPUT":U)) + : + run PublishResult {&insuper} ( input compilationunit, input tt_object.sourcefile, Modified: trunk/prolint/rules/wholeindex.p =================================================================== --- trunk/prolint/rules/wholeindex.p 2006-03-12 21:43:40 UTC (rev 258) +++ trunk/prolint/rules/wholeindex.p 2006-03-13 21:29:41 UTC (rev 259) @@ -36,6 +36,9 @@ DEFINE VARIABLE vOperation AS CHARACTER NO-UNDO. DEFINE VARIABLE vTable AS CHARACTER NO-UNDO. DEFINE VARIABLE vComment AS CHARACTER NO-UNDO. + DEFINE VARIABLE StripLdbName AS LOGICAL NO-UNDO. + + StripLdbName = LOGICAL (DYNAMIC-FUNCTION ("ProlintProperty", "rules.RemoveLogicalDatabaseName")). INPUT STREAM xrf FROM VALUE (xreffile). DO WHILE TRUE : @@ -60,12 +63,10 @@ IF (vOperation EQ "SEARCH":U) AND (vComment EQ "WHOLE-INDEX":U) THEN DO: - &IF DEFINED(EXCLUDE-remove-ldbname)=0 &THEN - /* strip ldbname from tablename. Use prolint/customize.i to suppress this */ - IF NUM-ENTRIES(vTable, '.':U)=2 THEN - vTable = ENTRY(2, vTable, '.':U). - &ENDIF - + IF StripLdbName THEN + IF NUM-ENTRIES(vTable, '.':U)=2 THEN + vTable = ENTRY(2, vTable, '.':U). + RUN PublishResult {&insuper} (compilationunit, vSourcefile, vLinenumber, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |