Compare commits

..
1 Commits
Author SHA1 Message Date
dc 0b85f7bf1e fix(lint): make noBannedStrings an error and clear its 13 findings
Build / Build-and-ng-test (pull_request) Successful in 6m42s
Lighthouse Checks / lighthouse (pull_request) Successful in 20m38s
Build / Build-and-test-development (pull_request) Successful in 35m26s
Rung 3 of the #376 ratchet: `sas/.sasjslint` promotes noBannedStrings to
"error". The rule flags the literal words "error " / "warning " anywhere in
a file, comments included, because they turn up in a grep of the SAS log
and bury the real messages. Its 13 findings are cleared:

- Nine are prose and are reworded, so the sentence both reads normally and
  stops matching: a truncation that aborts a build, a syntax fault, an
  abort condition, "only records the failure in work.mp_abort_errds" (four
  copies of the mp_abort-inside-%include comment), a test description, a
  hook comment.
- Two are the text the user sees. loadfile.sas reports
  "(mf_abort.error file found)" - the marker file carries the word in its
  name - and buildtermsas9.sas reports "Some final error in &_program";
  both are reworded to say the same thing without the literal, since the
  text sits in a macro argument where the %str(WARN)ING split does not
  survive the quoting.
- Three keep the word because the word is the content: the doxygen
  @warning tags in macros/bitemporal_dataloader.sas and the two SAS 9
  admin STPs (makedata, makelib). Each carries
  @sasjslint {"noBannedStrings": false}, as
  targets/server/services_server/admin/makedata.sas already did.

VERIFICATION

- `npm run lint:sas`: 5 warnings, 0 errors, exit 0.
- `sasjs compile`: succeeds.
- Deployed to sas.4gl.io and ran the SAS suite there:
  `sasjs test` reports "Tests that pass: 64/64 (100%)". The run used a
  scratch appLoc (/Public/app/dc-lint-ratchet) seeded with makedata, so
  the shared /Public/app/dc deployment was left alone; the scratch target
  was removed from sasjsconfig.json before this commit.

5 warnings remain: macro name length (2) and case (2),
indentationMultiple (1) - the last rung.
2026-11-01 01:52:06 +00:00
13 changed files with 16 additions and 11 deletions

No files matched your search

+2 -1
View File
@@ -15,6 +15,7 @@
"ignoreList":["sasjs/scratch"],
"severityLevel": {
"noUnusedMacros": "error",
"noUndeclaredMacros": "error"
"noUndeclaredMacros": "error",
"noBannedStrings": "error"
}
}
@@ -98,7 +98,7 @@ quit;
where var_name='DC_MAXCELLS_WEBEDIT' and var_active=1 and &now lt tx_to;
/* Why the cell limit exists, kept out of var_desc - MPE_CONFIG.VAR_DESC
is varchar(300), and a truncation WARNING aborts the build. A wide
is varchar(300), and a truncation aborts the build. A wide
table is expensive long before it is tall - 250 rows of a 1000 column
table is a quarter of a million cells. */
insert into &dclib..mpe_config
@@ -123,6 +123,8 @@ Areas for optimisation
@warning multitemporal loads (bitemporal for multiple points in business time)
are in experimental stage
@sasjslint {"noBannedStrings": false}
**/
%macro bitemporal_dataloader(
+1 -1
View File
@@ -97,7 +97,7 @@
/* dc_dttmtfmt is the bitemporal cut-off used in the where= below - callers get
it from %mpeinit(). Unset, the filter degenerates to "lt tx_to" and the
control-table step fails with a syntax error a long way from the cause. */
control-table step fails with a syntax fault a long way from the cause. */
%mp_abort(iftrue= (%length(&libds)=0 or %length(&dclib)=0 or %length(&dc_dttmtfmt)=0)
,mac=&sysmacroname
,msg=%str(Missing: libds dclib dc_dttmtfmt)
+1 -1
View File
@@ -22,5 +22,5 @@
%mp_assert(
iftrue=(&syscc = 0),
desc=Checking error condition
desc=Checking the abort condition
)
+1 -1
View File
@@ -704,7 +704,7 @@ run;
%postdata()
/* mp_abort cannot exit cleanly from inside a %include, so an abort there
(eg in a hook script run via mp_include) only records the error in
(eg in a hook script run via mp_include) only records the failure in
work.mp_abort_errds. mode=INCLUDE picks that up and aborts properly here. */
%mp_abort(mode=INCLUDE)
@@ -166,7 +166,7 @@ run;
/* execute the dynamic code */
%mp_include(sascode)
/* mp_abort cannot exit cleanly from inside a %include, so an abort there
(eg in a hook script run via mp_include) only records the error in
(eg in a hook script run via mp_include) only records the failure in
work.mp_abort_errds. mode=INCLUDE picks that up and aborts properly here. */
%mp_abort(mode=INCLUDE)
+2 -2
View File
@@ -292,14 +292,14 @@ options mprint;
,dc_dttmtfmt=&dc_dttmtfmt
)
/* mp_abort cannot exit cleanly from inside a %include, so an abort there
(eg in a hook script run via mp_include) only records the error in
(eg in a hook script run via mp_include) only records the failure in
work.mp_abort_errds. mode=INCLUDE picks that up and aborts properly here. */
%mp_abort(mode=INCLUDE)
%mp_abort(
iftrue= (%sysfunc(fileexist(%sysfunc(pathname(work))/mf_abort.error)) ne 0)
,mac=&_program
,msg=%nrstr(Problem occurred in &sysmacroname (mf_abort.error file found))
,msg=%nrstr(Problem occurred in &sysmacroname (abort marker file found))
)
%mp_abort(iftrue= (&syscc ne 0)
+1 -1
View File
@@ -155,7 +155,7 @@ run;
,dc_dttmtfmt=&dc_dttmtfmt
)
/* mp_abort cannot exit cleanly from inside a %include, so an abort there
(eg in a hook script run via mp_include) only records the error in
(eg in a hook script run via mp_include) only records the failure in
work.mp_abort_errds. mode=INCLUDE picks that up and aborts properly here. */
%mp_abort(mode=INCLUDE)
@@ -41,7 +41,7 @@ data work.staging_ds;
end;
end;
/* publish error message */
/* publish abort message */
if err=1 then do;
errmsg=catx(' ',xlmap_range_id,':',value_txt,'->',errmsg);
call symputx('errmsg',errmsg);
@@ -10,6 +10,7 @@
@warning This STP self destructs! It will delete itself after a successful run
to avoid being executed twice (and overwriting actual data)
@sasjslint {"noBannedStrings": false}
<h4> SAS Macros </h4>
@li mf_getapploc.sas
@@ -7,6 +7,7 @@
@warning This STP self destructs! It will delete itself after a successful run
to avoid being executed twice (and overwriting actual data)
@sasjslint {"noBannedStrings": false}
<h4> SAS Macros </h4>
@li mm_createlibrary.sas
+1 -1
View File
@@ -184,7 +184,7 @@ run;
%mp_abort(iftrue= (&syscc ne 0)
,mac=buildtermsas9
,msg=%str(Some final error in &_program )
,msg=%str(Some final problem in &_program )
)
/* delete if successful */
%mm_deletestp(target=&_program)