File: styleguide.md

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (42 lines) | stat: -rw-r--r-- 1,835 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Chromium coding style

## Main style guides

*   [Chromium C++ style guide](c++/c++.md)
    *   [Modern C++ use](c++/c++-features.md) for allowed/banned features.
    *   See also: [C++ Dos and Don'ts](c++/c++-dos-and-donts.md) for Chromium
        best-practices.
    *   [Blink C++ style](c++/blink-c++.md)
*   [Chromium Objective-C style guide](objective-c/objective-c.md)
*   [Chromium Swift style guide](swift/swift.md)
*   [Java style guide for Android](java/java.md)
*   [Chromium Python style guide](python/python.md)
    *   [Blink Python style](python/blink-python.md)
*   [GN style guide](https://gn.googlesource.com/gn/+/main/docs/style_guide.md)
    for build files.
    *   See also: [Writing GN templates](../build/docs/writing_gn_templates.md)
        for Chromium best-practices.
*   [Markdown style guide](markdown/markdown.md)

Chromium also uses these languages to a lesser degree:

*   [Kernel C style](https://www.kernel.org/doc/html/latest/process/coding-style.html)
    for ChromiumOS firmware.
*   [WebIDL](https://www.chromium.org/blink/webidl/#syntax)
*   [Mojo IDL](../docs/security/mojo.md) for cross-process IPC
*   [Jinja style guide](https://sites.google.com/a/chromium.org/dev/developers/jinja#TOC-Style)
    for [Jinja](https://sites.google.com/a/chromium.org/dev/developers/jinja)
    templates.
*   [SQLite SQL style](../sql/README.md#SQL-style) for storage of cookies, etc.

Regardless of the language used, please keep code
[inclusive for all contributors](inclusive_code.md).

## Web languages (JavaScript, HTML, CSS)

When working on Web-based UI features, consult the
[Web Development Style Guide](web/web.md) for the Chromium conventions used in
JS/CSS/HTML files.

Internal uses of web languages, notably "layout" tests, should preferably follow
these style guides, but it is not enforced.