History log of /llvm-project/clang/docs/tools/dump_format_style.py (Results 1 – 25 of 45)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6
# ea44647a 13-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Write in text mode with LF in dump_format_[help|style].py


# 411df3bb 09-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Make command lines of dump_format_[style|help].py consistent


# 74d29c63 06-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Open plurals.txt in read-only mode in dump_format_style.py


# a9a4a83b 05-Dec-2024 Aiden Grossman <aidengrossman@google.com>

[clang-format] Add test to ensure formatting options docs are updated (#118154)

This patch adds a lit test to clang format to ensure that the
ClangFormatStyleOptions doc page has been updated appro

[clang-format] Add test to ensure formatting options docs are updated (#118154)

This patch adds a lit test to clang format to ensure that the
ClangFormatStyleOptions doc page has been updated appropriately. The
test just runs the automatic update script and diffs the outputs to
ensure they are the same.

show more ...


Revision tags: llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1
# 3b5965e6 04-Mar-2024 PeterChou1 <peter.chou@mail.utoronto.ca>

[clang-format][doc] fix documentation for clang-format (#83415)

Fixes typo in documentation for clang-format

Fixes #83207.


Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3
# c5cbfc56 10-Feb-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Rename option AlwaysBreakTemplateDeclarations (#81093)

Drop the "Always" prefix to remove the self-contradiction.


Revision tags: llvmorg-18.1.0-rc2
# c806d8c7 31-Jan-2024 rmarker <37921131+rmarker@users.noreply.github.com>

[clang-format] Explicitly open DOC_FILE with utf-8 in dump_format_style.py (#79805)

The dump_format_style.py script generates the clang-format style options
documentation.
There was an issue where

[clang-format] Explicitly open DOC_FILE with utf-8 in dump_format_style.py (#79805)

The dump_format_style.py script generates the clang-format style options
documentation.
There was an issue where the script could include spurious characters in
the output when run in windows. It appears that it wasn't defaulting to
the correct encoding when reading the input.
This has been addressed by explicitly setting the encoding when opening
the file.

show more ...


Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4
# 7c15dd60 20-Oct-2023 Omar Ahmed <omarpiratee2010@gmail.com>

[clang-format] Add space in placement new expression

Add AfterPlacementNew option to SpaceBeforeParensOptions to have more
control on placement new expressions.

Fixes #41501
Relates to #54703

Diff

[clang-format] Add space in placement new expression

Add AfterPlacementNew option to SpaceBeforeParensOptions to have more
control on placement new expressions.

Fixes #41501
Relates to #54703

Differential Revision: https://reviews.llvm.org/D127270

show more ...


Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 9ec5dc69 09-Jul-2023 Gedare Bloom <gedare@rtems.org>

[clang-format] Add note directive generation for docs

Generate a ..note:: directive when the \note is encountered in Format.h.

Differential Revision: https://reviews.llvm.org/D154552


# f6d557ee 26-Jun-2023 Nikolas Klauser <nikolasklauser@berlin.de>

[clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

A lot of editors remove trailing whitespaces. This patch removes any trailing whitespaces and makes sure that no new

[clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

A lot of editors remove trailing whitespaces. This patch removes any trailing whitespaces and makes sure that no new ones are added.

Reviewed By: erichkeane, paulkirth, #libc, philnik

Spies: wangpc, aheejin, MaskRay, pcwang-thead, cfe-commits, libcxx-commits, dschuff, nemanjai, arichardson, kbarton, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, s.egerton, sameer.abuasal, apazos, luismarques, martong, frasercrmck, steakhal, luke

Differential Revision: https://reviews.llvm.org/D151963

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5
# dd3c26a0 17-May-2023 Tobias Hieta <tobias@hieta.se>

[NFC][Py Reformat] Reformat python files in clang and clang-tools-extra

This is an ongoing series of commits that are reformatting our
Python code.

Reformatting is done with `black`.

If you end up

[NFC][Py Reformat] Reformat python files in clang and clang-tools-extra

This is an ongoing series of commits that are reformatting our
Python code.

Reformatting is done with `black`.

If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.

If you run into any problems, post to discourse about it and
we will try to help.

RFC Thread below:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: MatzeB

Differential Revision: https://reviews.llvm.org/D150761

show more ...


Revision tags: llvmorg-16.0.4, llvmorg-16.0.3
# c12aa69a 29-Apr-2023 Jon Phillips <jonap2811@gmail.com>

[clang-format] Add BracedInitializerIndentWidth option

The option allows users to specify how many columns to use to indent
the contents of initializer lists.

Closes #51070.

Differential Revision:

[clang-format] Add BracedInitializerIndentWidth option

The option allows users to specify how many columns to use to indent
the contents of initializer lists.

Closes #51070.

Differential Revision: https://reviews.llvm.org/D146101

show more ...


Revision tags: llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# 9cddd7a2 12-Jan-2023 Emilia Dreamer <emilia@rymiel.space>

[clang-format][docs] Add ability to link to specific config options

This allows for the creation of permalinks to specific clang-format
options, for better sharing of a specific option and its optio

[clang-format][docs] Add ability to link to specific config options

This allows for the creation of permalinks to specific clang-format
options, for better sharing of a specific option and its options.

(I'm adding the usual clang-format reviewers on this patch because
I don't know any other reviewers that well, perhaps someone with
docs experience should be added instead...)

Note that I wanted to make minimal changes to make this happen and thus
landed on an unideal setup, but to me, it seems like the best out of
worse ones.

I could have made every style option a subheading, which would add
automatically the logic for permalinks and the little paragraph icon for
sharing.

However, this meant that the links themselves would be suboptimal, as
they'd include the whole text of the heading, including the type and
versionbadge, which is needless noise and could change, breaking the
concept of a "permalink". The format of the page could be changed to
put the option names on their own in a heading, and the other info below
it in a paragraph.

As Sphinx seems unwilling to fix https://github.com/sphinx-doc/sphinx/issues/1961,
there isn't a succinct way to change the "id" html field used for
sections

I could have used an add-on (https://github.com/GeeTransit/sphinx-better-subsection),
or made one myself, but I wanted to avoid extra dependencies for no
reason. (plus, I don't know how to make one myself.)

I could have used raw HTML for each heading, but that would immensely
pollute the rst file, which, while it is generated, is currently still
human-readable and it'd be nice for it to stay that way.

Also note that sphinx treats references as case-insensitive, which means
that they will all be lowercased in the resulting HTML. I envisioned
the ability to simply add #OptionName after the URL to get placed right
at the desired config option, which isn't possible without things such
as inline `raw` HTML.

To reconcile that, I added the ¶ paragraph buttons that can be used to
generate the link to the desired section, but since headings are not
actually used, they are faked and literally just a link following each
option, which means they stylistically don't match all other headings.

Also note that this sort-of assumes HTML output. I know Sphinx can
output other formats but I do not know if they are used. A non-html
output could embed unusable ¶ signs everywhere.

I'm okay with this patch being rejected in its current solution, or if
any of the above listed alternatives are better, they could be pursued
instead. In case the downsides of this solution are too much, I will
just create a feature request issue for this and maybe let someone more
experienced with Sphinx handle it, since this is still a feature I would
like to have. (and I do not want to deal with Sphinx at all after
battling with it for a whole day to produce a mediocre result.)

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay, aaron.ballman

Differential Revision: https://reviews.llvm.org/D138446

show more ...


Revision tags: llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6
# b1c300fe 11-Jun-2022 owenca <owenpiano@gmail.com>

[clang-format] Handle deprecated options in dump_format_style.py

Also add two deprecated options as comments back to Format.h.


Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0
# 93b5505b 14-Mar-2022 sstwcw <f0gukp2nk@protonmail.com>

[clang-format] Extract doc for entire configuration structs

Previously the comments for configuration structs as a whole like
`BraceWrappingFlags` did not go into the doc.

Reviewed By: curdeius

Di

[clang-format] Extract doc for entire configuration structs

Previously the comments for configuration structs as a whole like
`BraceWrappingFlags` did not go into the doc.

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D120361

show more ...


Revision tags: llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1
# 931d20c5 30-Oct-2021 Ludovic Jozeau <federandink@gmail.com>

[docs][clang-format] warn on \code block indentation error

There is an indentation issue in Format.h causing the html to not render correctly
It's a `\code` block in the documentation of SpacesInLin

[docs][clang-format] warn on \code block indentation error

There is an indentation issue in Format.h causing the html to not render correctly
It's a `\code` block in the documentation of SpacesInLineComment

- fix intentation of `SpacesInLineComment`
- warn on indentation error
- also warn on `\code` `\endcode` mismatch
- generate precise warnings
- fix some minor and style issues:
- avoid confusion with the built-in `type` function
- fix wrong print on `os.sys.stderr` (instead of `sys.stderr`)
- use `with as` pattern for files

Reviewed By: MyDeveloperDay, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D112572

show more ...


# 23a5090c 28-Sep-2021 mydeveloperday <mydeveloperday@gmail.com>

[clang-format][docs] mark new clang-format configuration options based on which version they would GA

Sometimes I see people unsure about which options they can use in specific versions of clang-for

[clang-format][docs] mark new clang-format configuration options based on which version they would GA

Sometimes I see people unsure about which options they can use in specific versions of clang-format because
https://clang.llvm.org/docs/ClangFormatStyleOptions.html points to the latest and greatest versions.

The reality is this says its version 13.0, but actually anything we add now, will not be in 13.0 GA but
instead 14.0 GA (as 13.0 has already been branched).

How about we introduce some nomenclature to the Format.h so that we can mark which options in the
documentation were introduced for which version?

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D110432

show more ...


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4
# 9e8fff26 24-Sep-2021 Ludovic Jozeau <federandink@gmail.com>

[clang-format][docs] Fix documentation of clang-format BasedOnStyle type

Fix little inconsistency and use `std::string` (which is used everywhere
else) instead of `string`

Reviewed By: MyDeveloperD

[clang-format][docs] Fix documentation of clang-format BasedOnStyle type

Fix little inconsistency and use `std::string` (which is used everywhere
else) instead of `string`

Reviewed By: MyDeveloperDay, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D108765

show more ...


# a44ab170 23-Sep-2021 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] Add Left/Right Const fixer capability

Developers these days seem to argue over east vs west const like they used to argue over tabs vs whitespace or the various bracing style. These p

[clang-format] Add Left/Right Const fixer capability

Developers these days seem to argue over east vs west const like they used to argue over tabs vs whitespace or the various bracing style. These previous arguments were mainly eliminated with tools like `clang-format` that allowed those rules to become part of your style guide. Anyone who has been using clang-format in a large team over the last couple of years knows that we don't have those religious arguments any more, and code reviews are more productive.

https://www.youtube.com/watch?v=fv--IKZFVO8
https://mariusbancila.ro/blog/2018/11/23/join-the-east-const-revolution/
https://www.youtube.com/watch?v=z6s6bacI424

The purpose of this revision is to try to do the same for the East/West const discussion. Move the debate into the style guide and leave it there!

In addition to the new `ConstStyle: Right` or `ConstStyle: Left` there is an additional command-line argument `--const-style=left/right` which would allow an individual developer to switch the source back and forth to their own style for editing, and back to the committed style before commit. (you could imagine an IDE might offer such a switch)

The revision works by implementing a separate pass of the Annotated lines much like the SortIncludes and then create replacements for constant type declarations.

Differential Revision: https://reviews.llvm.org/D69764

show more ...


Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init
# 25631471 25-Jan-2021 Lukas Barth <mail@lukas-barth.net>

[clang-format] Add the possibility to align assignments spanning empty lines or comments

Currently, empty lines and comments break alignment of assignments on consecutive
lines. This makes the Align

[clang-format] Add the possibility to align assignments spanning empty lines or comments

Currently, empty lines and comments break alignment of assignments on consecutive
lines. This makes the AlignConsecutiveAssignments option an enum that allows controlling
whether empty lines or empty lines and comments should be ignored when aligning
assignments.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, tinloaf

Differential Revision: https://reviews.llvm.org/D93986

show more ...


# 7b9d88ab 25-Jan-2021 Marek Kurdej <marek.kurdej@gmail.com>

Revert "[clang-format] Add the possibility to align assignments spanning empty lines or comments"

This reverts commit f00a20e51c1d186e72844939aad10416e1cc99de.


# f00a20e5 25-Jan-2021 Marek Kurdej <marek.kurdej@gmail.com>

[clang-format] Add the possibility to align assignments spanning empty lines or comments

Currently, empty lines and comments break alignment of assignments on consecutive
lines. This makes the Align

[clang-format] Add the possibility to align assignments spanning empty lines or comments

Currently, empty lines and comments break alignment of assignments on consecutive
lines. This makes the AlignConsecutiveAssignments option an enum that allows controlling
whether empty lines or empty lines and comments should be ignored when aligning
assignments.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, tinloaf

Differential Revision: https://reviews.llvm.org/D93986

show more ...


Revision tags: llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1
# c7e825b9 23-Dec-2020 Nathan James <n.james93@hotmail.co.uk>

[format][NFC] Use unsigned char as the base of all enums in FormatStyle

This removes alot of unnecessary padding, trimming the size of the struct from 728->608 on 64 bit platforms.

Reviewed By: MyD

[format][NFC] Use unsigned char as the base of all enums in FormatStyle

This removes alot of unnecessary padding, trimming the size of the struct from 728->608 on 64 bit platforms.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D93758

show more ...


Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1
# 3125aa99 07-May-2020 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] ensure dump_format_style.py works with Python3 correctly

Summary:
Python2 has been removed from cygwin, this means anyone running the dump_format_style.py in a cygwin shell could pick

[clang-format] ensure dump_format_style.py works with Python3 correctly

Summary:
Python2 has been removed from cygwin, this means anyone running the dump_format_style.py in a cygwin shell could pick up python3 instead

In Python3 all strings are unicode as the file is opened in binary mode we need to encode the contents string or we'll face the following error

```
Traceback (most recent call last):
File "./dump_format_style.py", line 228, in <module>
output.write(contents)
TypeError: a bytes-like object is required, not 'str'
```

Reviewed By: krasimir

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D79326

show more ...


Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1
# eb00839c 08-Nov-2019 paul_hoad <paul_hoad@amat.com>

[clang-format] Ensure dump_format_style.py can generate ClangFormatStyleOptions.rst without manual intervention

Summary:
This revision is the last in a series of revisions to return `clang/doc/tools

[clang-format] Ensure dump_format_style.py can generate ClangFormatStyleOptions.rst without manual intervention

Summary:
This revision is the last in a series of revisions to return `clang/doc/tools/dump_format_style.py` to be being able to parse Format.h without needing to manually merge the ClangFormatStyleOptions.rst file.

The final modification to dump_format_style.py is needed following the addition of a nested enumeration inside a nested structure following the introduction of {D68296}

Prior related revisions will allow for a fully clang-formatted `clang/include/clang/Format/Format.h` to once again be used at the source.
{D69951}
{D69433}
{D69404}

Reviewers: mitchell-stellar, klimek, sammccall, owenpan

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D70003

show more ...


12