Recent

Author Topic: Compile Messages and JCF Messages  (Read 940 times)

MSABC

  • New Member
  • *
  • Posts: 43
Compile Messages and JCF Messages
« on: May 21, 2018, 11:27:34 am »
Hi,

I recently noticed,that the code formatter JCF brings up some useful hints
like case sections without else, complains about *.destroy and others in the message window.

 - JCF doesn't start the messages window, so you have to be aware, that there may be such hints.
 - JCF only works on one single unit. 
 - These messages would als be usefull after a compiler run.

Is it possible to do the same checks with each compiler run or to let JCF run over the whole project?
I did not find any options in the project settings.

Thanks in advance

MSABC



Bogen85

  • Full Member
  • ***
  • Posts: 166
Re: Compile Messages and JCF Messages
« Reply #1 on: September 28, 2022, 01:20:47 am »
I run JCF from the command line and let it operate on entire directories.

Not sure it this would help you.


Using lazbuild, build the components/jcf2/CommandLine/Lazarus/JCF.lpr package
(may need to symlink jcf.lpi in there to JCF.lpi, the paths are cased incorrectly).
resulting binary is in components/jcf2/Output/Lazarus/JCF


But yeah, it does have lots of hints, which are useful.

Code: Text  [Select][+][-]
  1. $ JCF -config=jcfsettings.cfg  -?
  2. No path found
  3.  
  4. JEDI Code Format V2.44
  5.  August 2009
  6.  A Delphi Object-Pascal Source code formatter
  7.  A GUI version of this program is also available
  8.  Latest version at http://jedicodeformat.sourceforge.net/
  9.  
  10. Syntax: jcf [options] path/filename
  11.  Parameters to the command-line program:
  12.  
  13.  Mode of operation:
  14.  -obfuscate Obfuscate mode or
  15.  -clarify Clarify mode
  16.    When neither is specified, registry setting will be used.
  17.    This normally means clarify.
  18.  
  19.  Mode of source:
  20.  -F Format a file. The file name must be specified.
  21.  -D Format a directory. The directory name must be specified.
  22.  -R Format a directory tree. The root directory name must be specified.
  23.   When no file mode is specified, registry setting will be used.
  24.  
  25.  Mode of output:
  26.  -inplace change the source file without backup
  27.  -out output to a new file
  28.  -backup change the file and leave the original file as a backup
  29.   If no output mode is specified, registry setting will be used.
  30.  
  31.  Other options:
  32.  -config=filename  To specify a named configuration file
  33.  -y Overwrite files without confirmation.
  34.  -? Display this help
  35.  


Previously I ran lazarus and went into the Jedi Code Formatter setup to configure JCF.
This produces ~/.lazarus/jcfsettings.cfg which I copy to where I use it.
JCF -config=jcfsettings.cfg -inplace -R .

 

TinyPortal © 2005-2018