Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ the Engine development environment][engine_dev_setup] on our wiki. Those
instructions are part of the broader onboarding instructions described in the
contributing guide.

### Style

The Flutter engine follows Google style for the languages it uses:
- [C++](https://google.github.io/styleguide/cppguide.html)
- [Objective-C](https://google.github.io/styleguide/objcguide.html) (including
[Objective-C++](https://google.github.io/styleguide/objcguide.html#objective-c))
- [Java](https://google.github.io/styleguide/javaguide.html)

C++ and Objective-C/C++ files are formatted with `clang-format`, and GN files with `gn format`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should clarify that clang-format must be invoked with the -file argument so that it picks up the .clang-format specification. By default, I don't think it respects the nearest .clang-format file. Also, mention that both clang-format and gn must be picked from either buildtools or third_party/gn so that folks don't end up using disparate versions of auto-formatter which may have slightly differing opinions on the same format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was intending this to be advisory, rather than full instructions. I think if we want detailed instructions we should probably put them on another page and link to them from this sentence. Inlining instructions that work for all platforms would probably be more text than the page currently has...


[build_status]: https://cirrus-ci.com/github/flutter/engine
[code_of_conduct]: https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md
[contrib_guide]: https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md
Expand Down