Style guide - flutter-tizen/flutter-tizen GitHub Wiki

Dart

Any Dart code in this project should follow the Flutter repo's coding convention. It is also highly recommended to read the Dart style guide before you start writing code.

If you're using Visual Studio Code, you can use the Dart extension to automatically format and analyze your code:

  1. Install the Dart extension.
  2. Run the flutter-tizen command at least once from the command line.
  3. Add the root of this repo (which contains the analysis_options.yaml file) to your workspace.
  4. Enable Format on Save in the settings.

C/C++

Any C/C++ code in this project should follow Google's C++ style guide.

To verify the formatting of your code with clang-format, install clang-format-16 from https://apt.llvm.org and run:

$ clang-format-16 [<file> ...]

If you're using Visual Studio Code, you can use the C/C++ extension to format your code automatically:

  1. Install the C/C++ extension.
  2. Enable Format on Save in the settings.
  3. (Optional) If you don't want to use the extension's built-in clang-format executable, you can customize the clang-format path in the extension settings:

    "C_Cpp.clang_format_path": "/usr/bin/clang-format-16",

You might also read:

GN

Any GN file (.gn) in the embedder repo should follow Google's GN style guide.

After setting up the build environment by following the instructions in the repo's README, run the following command to format your GN file(s).

$ third_party/gn/gn format [<file> ...]

Python

There's no strict rule for styling Python code in this project. However, we generally use the autopep8 formatter bundled with the Python extension of VS Code to format the Python code.

The default indent size of autopep8 is 4, so you need to add the following arguments to Autopep8 Args in the VS Code settings.

"python.formatting.autopep8Args": [
  "--indent-size=2",
  "--ignore=E121"
],
⚠️ **GitHub.com Fallback** ⚠️