Coder Social home page Coder Social logo

Comments (6)

KittenPopo avatar KittenPopo commented on August 28, 2024 2

I recommend adding:

SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
NamespaceIndentation: All
AlignTrailingComments: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: Empty
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: No
BinPackArguments: false
BinPackParameters: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
ObjCBinPackProtocolList: Auto
SpaceAfterCStyleCast: false
SpaceInEmptyParentheses: false
Standard: Cpp11

This fixes basically all the wacky issues with clang-format, and specifies some more strict formatting rules (I based this on what is already used in the code).

from northstarlauncher.

cpdt avatar cpdt commented on August 28, 2024 2

These lines from @KittenPopo's config should be enough to fix those pathological "to the moon" cases:

BinPackArguments: false
BinPackParameters: false
ExperimentalAutoDetectBinPacking: false

clang-format 14 also supports AlignAfterOpenBracket: BlockIndent, which turns this:

NSMem::BytePatch(
    ba + 0x18ED8D,
    {
        0xC3 // jmp => ret
    });

into this, which is maybe a bit cleaner:

NSMem::BytePatch(
    ba + 0x18ED8D,
    {
        0xC3 // jmp => ret
    }
);

from northstarlauncher.

KittenPopo avatar KittenPopo commented on August 28, 2024 1

Sweet, we should upgrade to 14!

into this, which is maybe a bit cleaner:

NSMem::BytePatch(
    ba + 0x18ED8D,
    {
        0xC3 // jmp => ret
    }
);

Much cleaner! This is what I was trying to get clang-format to do lol

from northstarlauncher.

GeckoEidechse avatar GeckoEidechse commented on August 28, 2024

^--- @abarichello might wanna check that out ;)

from northstarlauncher.

GeckoEidechse avatar GeckoEidechse commented on August 28, 2024

clang-format 14 only released like 3 weeks ago, so the action we use doesn't support it yet :c

I opened an issue with them for now to see if/when support will be added.

from northstarlauncher.

GeckoEidechse avatar GeckoEidechse commented on August 28, 2024

Before messing with clang-format we should probably make sure that it accepts current code. Hence #143 to format code to current version of clang-format.

from northstarlauncher.

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.