Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

coding style

Lin Xie edited this page Jan 8, 2020 · 1 revision

We don't change the code style of FFmpeg original code. But use Clang formatter for our code. There is a config for clang-format-7 (.clang-format in the scripts folder of project). Hence, you need to install it locally and configure your IDE to format your code by using it.

Install clang formatter

If you are using Ubuntu 18.04 it’s quite simple:

sudo apt install -y clang-format-7
sudo ln -s /usr/bin/clang-format-7 /usr/bin/clang-format

If you are using different distro you can find an appropriate repository here https://apt.llvm.org/. And install the newest version:

sudo apt install -y clang-format-9
sudo ln -s /usr/bin/clang-format-9 /usr/bin/clang-format

Configure IDE

  • Visual Studio Code If you are using VS Code you just need to install corresponding extension clang-format and configure autoformat on save (you can find instruction on the extension page).

  • Different IDE If you are using different IDE or text editor please find an appropriate instruction by yourself and suggest updates for this wiki. We would be glad to accept your contributions.

Clone this wiki locally