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

Additional Linter Options

Open js-mason opened this issue 1 year ago • 1 comments

I have one linter config setup for our shop and share it between our developers in order to keep our code consistent. This works, but I see an opportunity for additional code formatting options in the rpgle linter. Here are several suggestions...

- Include space after "(" and before ")" ; 
         example:   Int(10)    would be converted to   Int( 10 )

-  Include space [ before | after | nospace ] with the parameter separator ":" character
         example:    nospace     Procedure( Parm1:Parm2:Parm3 )
                            before         Procedure( Parm1 :Parm2 :Parm3 )
                            after            Procedure( Parm1: Parm2: Parm3 )

-  Require or remove Const keyword on Dcl-C statements
          example:     require      Dcl-C  SOMECONSTANT  Const( 'XYZ' );
                              remove      Dcl-C  SOMECONSTANT   'XYZ';

js-mason avatar Sep 29 '23 15:09 js-mason

I suggest adding an additional option surround for the parameter separator:

-  Include space [ before | after | surround | nospace ] with the parameter separator ":" character
         example:    nospace     Procedure( Parm1:Parm2:Parm3 )
                     before      Procedure( Parm1 :Parm2 :Parm3 )
                     after       Procedure( Parm1: Parm2: Parm3 )
                     surround    Procedure( Parm1 : Parm2 : Parm3 )

chrjorgensen avatar Oct 05 '23 12:10 chrjorgensen