D29327: Improve a bit parse error diagnosis

Jarosław Staniek noreply at phabricator.kde.org
Sun May 10 22:51:56 BST 2020


staniek accepted this revision.
staniek added inline comments.
This revision is now accepted and ready to land.

INLINE COMMENTS

> jfita wrote in KDbSqlScanner.l:40
> Sorry, did not know i could run clang-format on flex sources. Will use it next time.
> 
> Do you have the correct .clang-format file, though? I tried clang-format with WebKit-based style but it resulted in massive changes to this file and other C++ sources i tried.
> 
> Thank you.

Sorry, we should have it in the repo, I thing we never added it after splitting repositories.

This is what I use at the moment:

  BasedOnStyle:  WebKit
  Language:        Cpp
  AccessModifierOffset: -4
  ConstructorInitializerIndentWidth: 4
  AlignEscapedNewlinesLeft: false
  AlignTrailingComments: false
  AlignAfterOpenBracket: Align
  AllowAllParametersOfDeclarationOnNextLine: true
  AllowShortIfStatementsOnASingleLine: false
  AllowShortLoopsOnASingleLine: false
  AllowShortFunctionsOnASingleLine: false
  AlwaysBreakTemplateDeclarations: false
  AlwaysBreakBeforeMultilineStrings: false
  BreakBeforeBraces: Linux
  BreakBeforeBinaryOperators: true
  BreakBeforeTernaryOperators: true
  BreakConstructorInitializersBeforeComma: true
  BinPackParameters: true
  ColumnLimit:     100
  ConstructorInitializerAllOnOneLineOrOnePerLine: true
  #DerivePointerBinding: false
  #ExperimentalAutoDetectBinPacking: false
  IndentCaseLabels: false
  MaxEmptyLinesToKeep: 1
  NamespaceIndentation: None
  ObjCSpaceBeforeProtocolList: true
  PenaltyBreakBeforeFirstCallParameter: 19
  PenaltyBreakComment: 60
  PenaltyBreakString: 1000
  PenaltyBreakFirstLessLess: 120
  PenaltyExcessCharacter: 1000000
  PenaltyReturnTypeOnItsOwnLine: 60
  PointerBindsToType: false
  SpacesBeforeTrailingComments: 1
  Cpp11BracedListStyle: false
  Standard:        Cpp11
  IndentWidth:     4
  TabWidth:        8
  UseTab:          Never
  BreakBeforeBraces: Linux
  IndentFunctionDeclarationAfterType: false
  SpacesInParentheses: false
  SpacesInAngles:  false
  SpaceInEmptyParentheses: false
  SpacesInCStyleCastParentheses: false
  #SpaceAfterControlStatementKeyword: true
  SpaceBeforeAssignmentOperators: true
  ContinuationIndentWidth: 4

Configure it this way

F8308084: image.png <https://phabricator.kde.org/F8308084>

I realized quite recently there was added some automation: https://phabricator.kde.org/D24568 but I'd prefer not to alter so many lines just for formatting.

If we look af KF5 repos I think only few publish official clang-format, e.g. kactivities.git/.clang-format.

I think settings I pasted above reflect it as well as https://community.kde.org/Policies/Frameworks_Coding_Style not too loosely.

Regarding clang-format for flex files, it's not 100% supported but the code we discuss sits between %{ and %} and that seems to get formatted properly using clang-format if you select correct block.

REPOSITORY
  R15 KDb

BRANCH
  3.2

REVISION DETAIL
  https://phabricator.kde.org/D29327

To: jfita, staniek, piggz
Cc: Kexi-Devel-list, barman, wicik, staniek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kexi-devel/attachments/20200510/68501320/attachment.htm>


More information about the Kexi-devel mailing list