vscode-rpgle
vscode-rpgle copied to clipboard
Linter Directive: "// @rpglint-skip" failure
If I have code like this:
And I want to ignore the linting in this case because *N data structures cannot be qualified, it throws off subsequent indentation checks:

Sample code:
**free
ctl-opt debug option(*nodebugio: *srcstmt) dftactgrp(*no) actgrp(*caller)
main(Main);
dcl-s STDDSC packed(5:2) inz(9.0); //from Item Master External DS
// @rpglint-skip
dcl-ds *n ;
cost packed(10:0);
end-ds;
dcl-proc Main;
dsply %char(CalcDiscount(10000));
dsply %char(CalcDiscount(1000));
return;
end-proc;
// New routine replaces field STDDSC in Item Master
dcl-proc CalcDiscount ;
dcl-pi CalcDiscount packed(7:2);
iCost packed(7:2) value;
end-pi;
dcl-s StdDisc packed(5:2) inz(10);
dcl-s BigDisc packed(5:2) inz(5);
dcl-s wkDisc packed(7:2);
StdDsc = 99;
if (iCost >= 10000);
wkDisc = (iCost*BigDisc)/100;
Else;
wkDisc = (iCost*STDDSC)/100; // << Error here <<
endif;
Return wkDisc;
end-proc;
Looks like it's skipping the indent changes too. I understand the issue, so basically we want // @rpglint-skip to continue checking the indentation changes.
@worksofliam Yes, I think so: // @rpglint-skip would disable all linting on that line except for indention checking. This is kind of an edge case I turned up when experimenting with linting.
Is there a way to turn off indention checking for a source member? Like // @rpglint-noindentcheck.
@SJLennon it is not currently possible to turn off indentation checking for a specific file.
I really like the indentation feature.
Except when I'm inserting new code because it works faster than I can type of think and before I can get to the ; at the the line it nearly always has lit up the rest of the screen with indentation errors. But I'm getting used to it...
New rules have been added today. And it solves this problem.