From 099db0a93cb6c038764b29d98b4322a12ff9e5b6 Mon Sep 17 00:00:00 2001 From: Lou Amadio Date: Thu, 18 Nov 2021 11:54:30 -0800 Subject: [PATCH] Update formatter and attribution (#603) * Update formatter and attribution * sp --- CHANGELOG.md | 3 ++ README.md | 1 + THIRD_PARTY_NOTICE.md | 31 ++++++++++++- src/cpp-formatter.ts | 104 ++++++++++++++++++++++++------------------ 4 files changed, 93 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f80399..8cc53c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.7.0 +* Update 3rd party disclosure and attribution + ## 0.6.9 * [#429] Contribution by RyanDraves - Start ROS Core/Daemon if not running when launch debugging * [#435] Contribution by RyanDraves - Support ROS Test launch file debugging diff --git a/README.md b/README.md index 250cac32..269b07c7 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ A big ***Thank you!*** to everyone that have helped make this extension better! * Andrew Short ([@ajshort](https://github.com/ajshort)), **original author** * James Giller ([@JamesGiller](https://github.com/JamesGiller)) +* PickNikRobotics ([@PickNikRobotics](https://github.com/PickNikRobotics)) for code formatting ### ROS Web Tools This extension leverages [ROS Web Tools](http://robotwebtools.org/) for URDF Previewing. diff --git a/THIRD_PARTY_NOTICE.md b/THIRD_PARTY_NOTICE.md index 538d0762..e1a4a396 100644 --- a/THIRD_PARTY_NOTICE.md +++ b/THIRD_PARTY_NOTICE.md @@ -299,4 +299,33 @@ POSSIBILITY OF SUCH DAMAGE. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -``` \ No newline at end of file +``` + +## `PickNikRobotics/roscpp_code_format` ORIGINAL LICENSE +Copyright (c) 2015, Dave Coleman +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of roscpp_code_format nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/cpp-formatter.ts b/src/cpp-formatter.ts index 224aaacf..308c76cc 100644 --- a/src/cpp-formatter.ts +++ b/src/cpp-formatter.ts @@ -8,51 +8,65 @@ import * as vscode from "vscode"; * @link https://github.com/davetcoleman/roscpp_code_format */ const CLANG_FORMAT_STYLE = { - AccessModifierOffset: -2, - AlignEscapedNewlinesLeft: false, - AlignTrailingComments: true, - AllowAllParametersOfDeclarationOnNextLine: false, - AllowShortFunctionsOnASingleLine: "None", - AllowShortIfStatementsOnASingleLine: false, - AllowShortLoopsOnASingleLine: false, - AlwaysBreakBeforeMultilineStrings: false, - AlwaysBreakTemplateDeclarations: true, - BasedOnStyle: "Google", - BinPackParameters: true, - BreakBeforeBinaryOperators: false, - BreakBeforeBraces: "Allman", - BreakBeforeTernaryOperators: false, - BreakConstructorInitializersBeforeComma: true, - ColumnLimit: 120, - ConstructorInitializerAllOnOneLineOrOnePerLine: true, - ConstructorInitializerIndentWidth: 2, - ContinuationIndentWidth: 4, - Cpp11BracedListStyle: false, - DerivePointerBinding: true, - ExperimentalAutoDetectBinPacking: false, - IndentCaseLabels: true, - IndentFunctionDeclarationAfterType: false, - IndentWidth: 2, - MaxEmptyLinesToKeep: 1, - NamespaceIndentation: "None", - ObjCSpaceBeforeProtocolList: true, - PenaltyBreakBeforeFirstCallParameter: 19, - PenaltyBreakComment: 60, - PenaltyBreakFirstLessLess: 1000, - PenaltyBreakString: 1, - PenaltyExcessCharacter: 1000, - PenaltyReturnTypeOnItsOwnLine: 90, - PointerBindsToType: false, - SpaceAfterControlStatementKeyword: true, - SpaceBeforeAssignmentOperators: true, - SpaceInEmptyParentheses: false, - SpacesBeforeTrailingComments: 2, - SpacesInAngles: false, - SpacesInCStyleCastParentheses: false, - SpacesInParentheses: false, - Standard: "Auto", - TabWidth: 2, - UseTab: "Never", + BasedOnStyle: "Google", + AccessModifierOffset: -2, + ConstructorInitializerIndentWidth: 2, + AlignEscapedNewlinesLeft: false, + AlignTrailingComments: true, + AllowAllParametersOfDeclarationOnNextLine: false, + AllowShortIfStatementsOnASingleLine: false, + AllowShortLoopsOnASingleLine: false, + AllowShortFunctionsOnASingleLine: "None", + AlwaysBreakTemplateDeclarations: true, + AlwaysBreakBeforeMultilineStrings: true, + BreakBeforeBinaryOperators: false, + BreakBeforeTernaryOperators: false, + BreakConstructorInitializersBeforeComma: true, + BinPackParameters: true, + ColumnLimit: 120, + ConstructorInitializerAllOnOneLineOrOnePerLine: true, + DerivePointerBinding: false, + PointerBindsToType: true, + ExperimentalAutoDetectBinPacking: false, + IndentCaseLabels: true, + MaxEmptyLinesToKeep: 1, + NamespaceIndentation: "None", + ObjCSpaceBeforeProtocolList: true, + PenaltyBreakBeforeFirstCallParameter: 19, + PenaltyBreakComment: 60, + PenaltyBreakString: 1, + PenaltyBreakFirstLessLess: 1000, + PenaltyExcessCharacter: 1000, + PenaltyReturnTypeOnItsOwnLine: 90, + SpacesBeforeTrailingComments: 2, + Cpp11BracedListStyle: false, + Standard: "Auto", + IndentWidth: 2, + TabWidth: 2, + UseTab: "Never", + IndentFunctionDeclarationAfterType: false, + SpacesInParentheses: false, + SpacesInAngles: false, + SpaceInEmptyParentheses: false, + SpacesInCStyleCastParentheses: false, + SpaceAfterControlStatementKeyword: true, + SpaceBeforeAssignmentOperators: true, + ContinuationIndentWidth: 4, + SortIncludes: false, + SpaceAfterCStyleCast: false, + BreakBeforeBraces: "Custom", + BraceWrapping: { + AfterClass: true, + AfterControlStatement: true, + AfterEnum : true, + AfterFunction : true, + AfterNamespace : true, + AfterStruct : true, + AfterUnion : true, + BeforeCatch : true, + BeforeElse : true, + IndentBraces : false + } }; /**