Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.1 KB

README.md

File metadata and controls

37 lines (24 loc) · 1.1 KB

apexfmt

Apexfmt formats Apex code. It uses tabs for indentation.

Given a file, it writes the formatted code to standard output by default. The --write/-w flag can be used to overwrite the original file(s). The --list/-l flag can be used to list files with formatting different from apexfmt's.

Usage

CLI

$ apexfmt -w sfdx/main/default/classes/*.cls sfdx/main/default/triggers/*.trigger

Vim

apexfmt is included as a default formatter in vim-autoformat.

Demo

Try out apexfmt in a browser at https://apexfmt.octoberswimmer.com/.

Thanks

apexfmt is inspired by gofmt.

The antlr4 grammar is based on the @nawforce's apex-parser grammar, which is originally based on the grammer used by @neowit's tooling-force.com.

apexfmt in the browser forked from go-fmt-wasm.