Child pages
  • Command-Line Source Code Formatter
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Preface

Command-line source code formatter is a special functionality within Intellij IDEA and Intellij-based products like PhpStorm, WebStorm and etc. which allows to format arbitrary files outside a project scope using an XML file with exported code style settings and a file specification which defines a file or a group of files to be formatted. Although subsequent sections refer to Intellij IDEA they are equally applicable to so-called small IDEs. For the file(s) to be formatted there should be corresponding plug-ins which support required file types. For example, PHP files will be formatted only if PHP plug-in is installed.

Formatter Launcher Script

The script is format.bat on Windows or format.sh on Linux/Mac(?) in <Intellij dir>/bin directory, where <Intellij dir> is Intellij IDEA's root installation directory. The script launches Intellij IDEA or Intellij-based IDE which formats specified files and quits. If launched without any parameters or -h parameter, the script outputs a list of its options.

TBD

  • No labels