Commit Graph

11 Commits

Author SHA1 Message Date
Konstantin Akimov
adc0e4b382
fix: apply changes for .clang-format to make it matched with our code style
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-Authored-By: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2024-03-25 02:53:22 +07:00
fanquake
db662cf843
Merge #17134: doc: Add switch on enum example to developer notes
c8961c7d9fed07190628cf01f9dfad971a942b99 doc: Add switch on enum example (Hennadii Stepanov)
11e3d5eb1d4a4b399b180083ec52484d53ebf724 util: Add AllowShortCaseLabelsOnASingleLine option (Hennadii Stepanov)

Pull request description:

  This PR documents a recurring issue:
  - #15938
  - #17105

ACKs for top commit:
  laanwj:
    Seems like good advice to me. ACK c8961c7d9fed07190628cf01f9dfad971a942b99
  practicalswift:
    ACK c8961c7d9fed07190628cf01f9dfad971a942b99
  promag:
    ACK c8961c7d9fed07190628cf01f9dfad971a942b99, no excuse now, thanks!

Tree-SHA512: 530da5117094ed1bfaa6e447089521bd2c86b0742758dbacec4e4f934dc07b0e24f15a1448c4d58e49905e8fd3797d87bcae5669a346d33ed4c2878a04891699
2022-04-02 09:19:20 +05:30
fanquake
ee752790cd Merge #19454: tools: .clang-format compat with clang versions < 9
b9253c7d2089d3d159dcc10118ce5a219d9a6881 tools: clang-format 6 compatibility (Jon Atack)

Pull request description:

  Our `.clang-format` settings inadvertently lost compatibility with Clang versions < 9 in #19095, including for Debian stable. This patch returns compatibility in the interim until the distros update. See discussion from https://github.com/bitcoin/bitcoin/pull/19095#issuecomment-651926138.

ACKs for top commit:
  MarcoFalke:
    Approach ACK b9253c7d2089d3d159dcc10118ce5a219d9a6881 , haven't tested

Tree-SHA512: 4af541a195f48d84ffb80e23aaefb624c66bc78f087c8d92b4af5a654420b69fedf25272c6e4fde2688ff88412d306b7a990ce1e15d8b24180374c625a253fb6
2021-07-15 19:30:07 -05:00
MarcoFalke
3f3bdafd4e Merge #19095: [tools] Update clang-format config for multi-line function declarations and calls
cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7 [tools] Update clang-format config (John Newbery)

Pull request description:

  In some cases, running clang-format has made code _less_ readable by joining declarations and calls for functions with many arguments into very long lines. For example:

  ```
  -    size_t getQueueInfo(std::chrono::system_clock::time_point &first,
  -                        std::chrono::system_clock::time_point &last) const;
  +    size_t getQueueInfo(std::chrono::system_clock::time_point& first, std::chrono::system_clock::time_point& last) const;
  ```

  (https://github.com/bitcoin/bitcoin/pull/19090#discussion_r431961148)

  This change to clang-format would allow arguments/parameters for func declarations/calls to be split over multiple lines, aligned with the opening parens. It does not force args/params to be on new lines (that setting is `BinPackParameters : true`).

ACKs for top commit:
  MarcoFalke:
    ACK cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7 fine with me
  practicalswift:
    ACK cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7

Tree-SHA512: a62474925e71aaff41bdce7960fd5ffd64317da810f694d8084080b054708cf71c2ab2ce3111db5a9260d1c1f9e02d59a2ecb5543b1b6172ce085cb42432160a
2021-07-15 15:52:05 -05:00
MarcoFalke
e5b434d411 Merge #12982: Fix inconsistent namespace formatting guidelines
cd0e1e91dd Fix inconsistent namespace formatting guidelines (Russell Yanofsky)

Pull request description:

  Suggested formatting for namespaces in the developer guide is currently inconsistent. This commit updates the developer guide and clang-format configuration to consistently put "namespace" and opening/closing braces on the same line. Example:

  ```c++
  namespace boost {
  namespace signals2 {
  class connection;
  } // namespace signals2
  } // namespace boost
  ```

  Currently the [Source code organization](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#source-code-organization) section has an example like the one above, but the [Coding style](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#coding-style) section example and description put a newline between the opening "namespace foo" and brace (but oddly no newline between closing namespace and brace).

  Avoiding newlines before namespace opening braces makes nested declarations less verbose and also avoids asymmetry with closing braces. It's also a common style used in our own and other codebases:

  * https://google.github.io/styleguide/cppguide.html#Namespaces
  * https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Classes
  * https://llvm.org/docs/CodingStandards.html#namespace-indentation

Tree-SHA512: 507259478e1a7f6f96db386dd04eb25aa04294f533503fdd82368cf809c3ceaa20204b2cb6ae65322eb27446e5934c1aa1ccb6240ead12aa06b314af76f68139
2020-06-27 10:43:32 -05:00
Jorge Timón
0fe9f757ec
\#10193 clang-format: Delete ForEachMacros 2019-07-24 11:59:09 -05:00
Pieter Wuille
8c4e351c8a Merge #10602: Make clang-format use C++11 features (e.g. A<A<int>> instead of A<A<int> >)
131a8ceb7 Make clang-format use C++11 features (e.g. A<A<int>> instead of A<A<int> >) (practicalswift)

Tree-SHA512: e3c0ee683b654eae638deb41c52cf3187fa958dc5fa67778eaf8a83946b63f5b1d24c47bb965eaa910e3fcdcaf9eebf461eb3fc8e3a73ebaf03c7904521fda00
2019-07-09 13:08:21 -05:00
PastaPastaPasta
3d48824b48 Update .clang-format to more accurately show the actual style (#2299)
* updated clang formatting

* add `BreakConstructorInitializers: AfterColon`

* revert column limit change

* AlignConsecutiveAssignments: true

* Revert "AlignConsecutiveAssignments: true"

This reverts commit fc4a4a54f7.
2018-09-20 15:40:00 +03:00
MarcoFalke
e24b8ae50e Merge #9649: [doc] Remove unused clang format dev script
fa5137c [doc] Remove unused clang format dev script (MarcoFalke)
2018-01-23 09:24:26 +01:00
MarcoFalke
e0eeb672f2 [trivial] clang-format: Set AlignAfterOpenBracket: false 2015-11-05 23:28:02 +01:00
Pieter Wuille
2887bffcfd Update coding style and add .clang-format 2014-07-28 22:08:13 +02:00