Feedback for `lfortran fmt` to format Fortran source code

As reference, here are the options of findent:

~/findent-3.1.7$ findent -h
findent [options]
   Format fortran source.
   Findent reads from STDIN, writes to STDOUT.
   Findent uses various kinds of indentations, see OPTIONS.
   Findent can convert from fixed form to free form and vice versa and
   can supplement END statements, see 'Refactor' below.
   Comment lines with '!' in column one are not indented.
   You can correct findent related indenting errors by
   inserting comment lines: 
    !  findentfix: <fortran statement>
   where <fortran statement> is for example DO, END, WHERE() etcetera.
   Findent will adjust the indentation according to <fortran statement>.
OPTIONS (errors are silently ignored):

  General options:

 	  Below: <n> denotes an unsigned decimal number.
 	         <c> denotes a character.
 	   
 	  In the long options, you can replace '_' with '-'.

-h, --help	: print this text
-H, --manpage	: print man page
--readme	: print some background information
-v, --version	: prints findent version
-q, --query_fix_free	: guess free or fixed, prints 'fixed' or 'free' and exits
--continuation=<c>	:  ' ': (default) do not change continuation characters
 	   '0': create numbered continuation characters
 	   other: use that continuation character
 	   default for conversion from free to fixed is '&'
--include_left=<n>	: (0/1) 1: indent include statements to starting indent (default:0)
-l<n>, --label_left=<n>	: (0/1) 1: move statement labels to start of line (default:1)
 	        (only for free format)
-lastindent, --last_indent	: prints computed indentation of last line
 	        (for usage with vim)
-lastusable, --last_usable	: prints line number of last line usable
 	        as start for indenting(for usage with vim)
-iauto, --input_format=auto	: determine automatically input format (free or fixed)
-ifixed, --input_format=fixed	: force input format fixed
 	  (default: auto)
-ifree, --input_format=free	: force input format free
 	  (default: auto)
-i-, --indent=none	: do not change indent (useful in combination with -R)
-L<n>, --input_line_length=<n>	: use only first <n> characters of each line
 	  default=0: take whole lines
-L<n>g, --input_line_length=<n>g	: same as above, but use gfortran convention
 	  for counting the characters with tabbed lines
 	   example: --input_line_length=72g
-M<n>, --max_indent=<n>	: maximum output indent, default 100, 0: no limit
-ofixed, --output_format=fixed	: force fixed format output
-ofree, --output_format=free	: force free format output
-osame, --output_format=same	: output format same is input format
--openmp=<n>	:  0: do not indent openmp conditionals
 	   1: indent openmp conditionals (default)
 	   NOTE: for free format, the omp sentinel must be '!$ '
-Rr, --refactor_procedures	: refactor procedures and modules: the END line
 	   of a subroutine, program etc. is, if possible, replaced by
 	   'end subroutine <name>' or
 	   'end function <name>' or
 	   'end procedure <name>' or
 	   'end program <name>' or
 	   'end block data <name>' or
 	   'end module <name>' or
 	   'end submodule <name>'
 	   where <name> is the name of the appropriate procedure, subroutine etc.
 	   NOTE1: if the END line contains a continuation the results are undefined
 	   NOTE2: a line like 'end function fun' will be replaced by
 	          'end subroutine sub' if the END line ends 'subroutine sub'
-RR, --refactor_procedures=upcase	: same as -Rr, but 'END SUBROUTINE <name>'
 	  in stead of 'end subroutine <name>' etc.

  Indenting options:

-I<n>, --start_indent=<n>	: starting  indent (default:0)
-Ia, --start_indent=a	: determine starting indent from first line
-i<n>, --indent=<n>	: all       indents except I,c,C,e (default: 3)
-a<n>, --indent_associate=<n>	: ASSOCIATE    indent
-b<n>, --indent_block=<n>	: BLOCK        indent
-d<n>, --indent_do=<n>	: DO           indent
-f<n>, --indent_if=<n>	: IF           indent
-E<n>, --indent_enum=<n>	: ENUM         indent
-F<n>, --indent_forall=<n>	: FORALL       indent
-j<n>, --indent_interface=<n>	: INTERFACE    indent
-m<n>, --indent_module=<n>	: MODULE       indent
-r<n>, --indent_procedure=<n>	: FUNCTION,
 	   SUBROUTINE and PROGRAM indent
-s<n>, --indent_select=<n>	: SELECT       indent
-t<n>, --indent_type=<n>	: TYPE         indent
-w<n>, --indent_where=<n>	: WHERE        indent
-x<n>, --indent_critical=<n>	: CRITICAL     indent
--indent_changeteam=<n>     	: CHANGE TEAM  indent
-C-, --indent_contains=restart, 	: restart indent after CONTAINS
-k<n>, --indent_continuation=<n>	: continuation indent except   
 	    for lines starting with '&'
 	       free to free only
-k-, --indent_continuation=none	: continuation lines not preceded
 	    by '&' are untouched
 	       free to free only
  	: next defaults are: all - all/2
-c<n>, --indent_case=<n>	: CASE      negative indent
-C<n>, --indent_contains=<n>	: CONTAINS  negative indent
-e<n>, --indent_entry=<n>	: ENTRY     negative indent
 	   
Dependencies:
--deps	: output dependency information only, other flags are ignored.
 	  This can be used to generate a dependencies file for usage with make(1).
 	   The format of this information:
 	   Fortran source      ->        findent output
 	    include "file1"  ->        inc file1
 	    #include "file2" ->        cpp file2
 	    #include <file3>   ->        std file3
 	    ??include 'file4'  ->        coc file4
 	    use module1        ->        use module1
 	    submodule(m) subm  ->        use m
 	                                 mod m:subm
 	    module module2     ->        mod module2
--makefdeps	: outputs a sh(1) script that serves as a an example
 	   to generate dependencies for use in make(1).
1 Like