vscode-rpgle icon indicating copy to clipboard operation
vscode-rpgle copied to clipboard

Linter Directive: "// @rpglint-skip" failure

Open SJLennon opened this issue 3 years ago • 4 comments

If I have code like this: image And I want to ignore the linting in this case because *N data structures cannot be qualified, it throws off subsequent indentation checks: image

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;

SJLennon avatar May 17 '22 15:05 SJLennon

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 avatar May 29 '22 21:05 worksofliam

@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 avatar May 30 '22 02:05 SJLennon

@SJLennon it is not currently possible to turn off indentation checking for a specific file.

worksofliam avatar May 30 '22 14:05 worksofliam

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...

SJLennon avatar May 30 '22 21:05 SJLennon

New rules have been added today. And it solves this problem.

image image

worksofliam avatar Dec 22 '22 14:12 worksofliam