Git Product home page Git Product logo

Comments (6)

RUrlus avatar RUrlus commented on August 17, 2024

Sounds good, only strong preferences I have are:

  • 4 space indent
  • opening on same line, close on new line, e.g.
if (something) {
    do_something_here
}

Indent within namespaces I am fine with either indent or no indent

from carma.

hpwxf avatar hpwxf commented on August 17, 2024

Ok; understood 👍

from carma.

hpwxf avatar hpwxf commented on August 17, 2024

I suggest this configuration:
clang-format.txt

You can try it here https://zed0.co.uk/clang-format-configurator/ using upload feature.

from carma.

RUrlus avatar RUrlus commented on August 17, 2024

Only thing I don't like about the config is:

std::vector<uint32_t> returnVector( uint32_t* LongNameForParameter1,
                                    double* LongNameForParameter2,
                                    const float& LongNameForParameter3,
                                    const std::map<std::string,int32_t>& LongNameForParameter4) {

Preferring:

std::vector<uint32_t> returnVector(
    uint32_t* LongNameForParameter1,
    double* LongNameForParameter2,
    const float& LongNameForParameter3,
    const std::map<std::string, int32_t>& LongNameForParameter4
) {

However this doesn't seem possible, the closest I got:

std::vector<uint32_t> returnVector(
    uint32_t* LongNameForParameter1,
    double* LongNameForParameter2,
    const float& LongNameForParameter3,
    const std::map<std::string, int32_t>& LongNameForParameter4) {

What are your thoughts?

config:

---
BasedOnStyle: Chromium
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: All
BreakInheritanceList: BeforeComma
ColumnLimit: '120'
CompactNamespaces: 'false'
FixNamespaceComments: 'true'
IndentWidth: 4
UseTab: Never
ObjCBlockIndentWidth: 4
ContinuationIndentWidth: 4
AlignAfterOpenBracket: AlwaysBreak
IndentCaseLabels: true
AllowAllParametersOfDeclarationOnNextLine: false

from carma.

hpwxf avatar hpwxf commented on August 17, 2024

Except ObjCBlockIndentWidth which is for Objective-C code, I've updated clang-format following your config (cf #37).
(and I don't know how to do a style closer to your preferred style).

from carma.

RUrlus avatar RUrlus commented on August 17, 2024

Thanks for the work, closed by #37

from carma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.