Documentation/dev-tools/clang-format.rst

Source file repositories/reference/linux-study-clean/Documentation/dev-tools/clang-format.rst

File Facts

System
Linux kernel
Corpus path
Documentation/dev-tools/clang-format.rst
Extension
.rst
Size
6541 bytes
Lines
185
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: operation-table or driver-model contract
Status
pattern implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

static const struct file_operations uprobe_events_ops = {
                .owner          = THIS_MODULE,
                .open           = probes_open,
                .read           = seq_read,
                .llseek         = seq_lseek,
                .release        = seq_release,
                .write          = probes_write,
        };

    vs.::

        static const struct file_operations uprobe_events_ops = {
                .owner = THIS_MODULE,
                .open = probes_open,
                .read = seq_read,
                .llseek = seq_lseek,
                .release = seq_release,
                .write = probes_write,
        };


.. _clangformatextra:

Extra features/options
----------------------

Some features/style options are not enabled by default in the configuration
file in order to minimize the differences between the output and the current
code. In other words, to make the difference as small as possible,
which makes reviewing full-file style, as well diffs and patches as easy
as possible.

In other cases (e.g. particular subsystems/folders/files), the kernel style
might be different and enabling some of these options may approximate
better the style there.

For instance:

  - Aligning assignments (``AlignConsecutiveAssignments``).

  - Aligning declarations (``AlignConsecutiveDeclarations``).

  - Reflowing text in comments (``ReflowComments``).

  - Sorting ``#includes`` (``SortIncludes``).

They are typically useful for block re-formatting, rather than full-file.
You might want to create another ``.clang-format`` file and use that one
from your editor/IDE instead.

Annotation

Implementation Notes