Lines Matching +refs:clang +refs:format +refs:style
4 Mesa is over 20 years old and the coding style has evolved over time.
5 Some old parts use a style that's a bit out of date. Different sections
6 of mesa can use different coding style as set in the local EditorConfig
9 try following the format of existing, neighboring code.
11 ``clang-format``
14 A growing number of drivers and components are adopting ``clang-format``
17 You can re-format the code for the components that have opted-in to the
18 formatting enforcement (listed in ``.clang-format-include``) by simply
19 running ``ninja -C build/ clang-format``.
33 Add this to your ``.vimrc`` to automatically format any C & C++ file
34 (that has a .clang-format config) when you save it:
42 " Only format files that have a .clang-format in a parent folder
43 if !empty(findfile('.clang-format', '.;'))
44 let l:formatdiff = 1 " Only format lines that have changed
45 py3f /usr/share/clang/clang-format.py
52 If ``/usr/share/clang/clang-format.py`` doesn't exist, try
53 ``/usr/share/clang/clang-format-$CLANG_VERSION/clang-format.py``
54 (replacing ``$CLANG_VERSION`` with your clang version). If your distro
56 providing ``clang-format``.
61 Add this to your ``.emacs`` to automatically format any C & C++ file
62 (that has a .clang-format config) when you save it:
66 (load "/usr/share/clang/clang-format.el")
68 (defun clang-format-save-hook-for-this-buffer ()
72 (when (locate-dominating-file "." ".clang-format")
73 (clang-format-buffer))
81 (add-hook 'c-mode-hook (lambda () (clang-format-save-hook-for-this-buffer)))
82 (add-hook 'c++-mode-hook (lambda () (clang-format-save-hook-for-this-buffer)))
84 If ``/usr/share/clang/clang-format.el`` doesn't exist, look through the
85 files in the package providing ``clang-format`` in your distro. If you
87 answer <https://stackoverflow.com/questions/59690583/how-do-you-use-clang-format-on-emacs-ubuntu/59…
88 to install clang-format through Emacs instead.
94 can always just run ``ninja clang-format`` to format everything, or add
101 git clang-format $upstream -- $(grep -E '^[^#]' .clang-format-include)
134 developers. Several specific cases and style examples follow. Note