Style guide - flutter-tizen/flutter-tizen GitHub Wiki
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:
- Install the Dart extension.
- Run the
flutter-tizencommand at least once from the command line. - Add the root of this repo (which contains the
analysis_options.yamlfile) to your workspace. - Enable Format on Save in the settings.
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:
- Install the C/C++ extension.
- Enable Format on Save in the settings.
- (Optional) If you don't want to use the extension's built-in
clang-formatexecutable, you can customize theclang-formatpath in the extension settings:"C_Cpp.clang_format_path": "/usr/bin/clang-format-16",
You might also read:
- Recommended settings for VS Code
- Use of
autoin the embedder code - Refactoring guide for the plugins repo
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> ...]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"
],