Skip to content

Commit

Permalink
Merge 2b65633 into dc66d4e
Browse files Browse the repository at this point in the history
  • Loading branch information
pull[bot] authored Oct 13, 2023
2 parents dc66d4e + 2b65633 commit 1440808
Show file tree
Hide file tree
Showing 11,849 changed files with 1,806,272 additions and 1,211,458 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
126 changes: 5 additions & 121 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -107,129 +107,13 @@ Standard: Cpp11
TabWidth: 8
UseTab: Never
---
Language: ObjC
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: false
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: WebKit
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 132
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
Language: ObjC
BasedOnStyle: WebKit
Standard: c++17
PointerAlignment: Middle
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
SpaceInEmptyBlock: false
ObjCBreakBeforeNestedBlockParam: false
---
Language: JavaScript
BasedOnStyle: WebKit
Expand Down
45 changes: 28 additions & 17 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
---
Checks: >
readability-else-after-return,
modernize-use-nullptr,
bugprone-*,
-bugprone-not-null-terminated-result,
-bugprone-unused-return-value,
modernize-redundant-void-arg,
modernize-use-bool-literals,
modernize-use-nullptr,
performance-for-range-copy,
readability-const-return-type,
readability-else-after-return,
readability-redundant-control-flow,
readability-redundant-string-cstr,
readability-redundant-string-init,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-copy-constructor-init,
-bugprone-easily-swappable-parameters,
-bugprone-reserved-identifier,
-bugprone-macro-parentheses,
-bugprone-forward-declaration-namespace,
-bugprone-forwarding-reference-overload,
-bugprone-undelegated-constructor,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
-bugprone-inc-dec-in-conditions,
-bugprone-macro-parentheses,
-bugprone-misplaced-widening-cast,
-bugprone-suspicious-include,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result,
-bugprone-reserved-identifier,
-bugprone-signed-char-misuse,
-bugprone-copy-constructor-init,
-bugprone-suspicious-include,
-bugprone-switch-missing-default-case,
-bugprone-undelegated-constructor,
-bugprone-unused-return-value,
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-core.NullDereference,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-optin.performance,
-clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-cplusplus.Move,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-nullability.NullablePassedToNonnull,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker,
-clang-analyzer-optin.performance,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-security.insecureAPI.rand,
-clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-unix.Malloc,
-clang-diagnostic-implicit-int-conversion
WarningsAsErrors: '*'
Expand Down
81 changes: 35 additions & 46 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
ARG BUILD_VERSION

# All tools required for compilation belong in chip-build, forms "truth" for CHIP build tooling
FROM connectedhomeip/chip-build-vscode:${BUILD_VERSION}
FROM ghcr.io/project-chip/chip-build-vscode:${BUILD_VERSION}
LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip

# This Dockerfile contains things useful for an interactive development environment
ARG USERNAME=vscode
Expand All @@ -25,9 +26,10 @@ ENV LANG en_US.utf8

# these are installed for terminal/dev convenience. If more tooling for build is required, please
# add them to chip-build (in integrations/docker/images/chip-build)
RUN apt-get update
RUN apt-get install -y locales && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
RUN apt-get -fy install git vim emacs sudo \
RUN apt-get update \
&& apt-get install -y locales \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
&& apt-get -fy install git vim emacs sudo \
apt-utils dialog zsh \
iproute2 procps lsb-release \
bash-completion \
Expand All @@ -36,48 +38,32 @@ RUN apt-get -fy install git vim emacs sudo \
docker.io \
iputils-ping net-tools \
libncurses5 \
libpython2.7

RUN groupadd -g $USER_GID $USERNAME
RUN useradd -s /bin/bash -u $USER_UID -g $USER_GID -G docker -m $USERNAME
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
RUN chmod 0440 /etc/sudoers.d/$USERNAME

RUN mkdir -p /var/downloads
RUN cd /var/downloads
RUN curl -JL https://github.com/microsoft/vscode-cpptools/releases/download/0.27.0/cpptools-linux.vsix > extension.zip
RUN unzip extension.zip
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions
RUN mv extension /home/$USERNAME/.vscode-server/extensions/ms-vscode.cpptools-0.27.0
RUN mkdir -p /home/$USERNAME/bin
RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/restyle-path -o /home/$USERNAME/bin/restyle-path
RUN chmod +x /home/$USERNAME/bin/restyle-path
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME
RUN echo "PATH=/home/$USERNAME/bin:${PATH}" >> /home/$USERNAME/.bashrc

# $USERNAME needs to own the esp-idf and tools for the examples to build
RUN chown -R $USERNAME:$USERNAME /opt/espressif/esp-idf
RUN chown -R $USERNAME:$USERNAME /opt/espressif/tools

# $USERNAME needs to own west configuration to build nRF Connect examples
RUN chown -R $USERNAME:$USERNAME /opt/NordicSemiconductor/nrfconnect/

# allow read/write access to header and libraries
RUN chown -R $USERNAME:$USERNAME /opt/ubuntu-21.04-aarch64-sysroot/usr/

# allow licenses to be accepted
RUN chown -R $USERNAME:$USERNAME /opt/android/sdk

# AmebaD requires access to change build_info.h
RUN chown -R $USERNAME:$USERNAME /opt/ameba/ambd_sdk_with_chip_non_NDA/

# NXP uses a patch_sdk script to change SDK files
RUN chown -R $USERNAME:$USERNAME /opt/sdk/sdks/

RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-xwayland/5.15-kirkstone/

# Add access to openocd for VSCode debugging
RUN chown -R $USERNAME:$USERNAME /opt/openocd
libncursesw5 \
libpython2.7 \
&& :

RUN groupadd -g $USER_GID $USERNAME \
&& useradd -s /bin/bash -u $USER_UID -g $USER_GID -G docker,sudo -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& :

RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/restyle-path -o /usr/local/bin/restyle-path \
&& chmod +x /usr/local/bin/restyle-path \
&& :

RUN mkdir -p /opt/sdk/sdks/ \
&& chown -R $USERNAME:$USERNAME \
/opt/sdk/sdks/ `# NXP uses a patch_sdk script to change SDK files` \
/opt/espressif/esp-idf `# $USERNAME needs to own the esp-idf and tools for the examples to build` \
/opt/espressif/tools \
/opt/NordicSemiconductor/nrfconnect/ `# $USERNAME needs to own west configuration to build nRF Connect examples` \
/opt/ubuntu-21.04-aarch64-sysroot/usr/ `# allow read/write access to header and libraries` \
/opt/android/sdk `# allow licenses to be accepted` \
/opt/ameba/ambd_sdk_with_chip_non_NDA/ `# AmebaD requires access to change build_info.h` \
/opt/fsl-imx-xwayland/5.15-kirkstone/ \
/opt/openocd \
&& :

# Fix Tizen SDK paths for new user
RUN sed -i '/^TIZEN_SDK_DATA_PATH/d' $TIZEN_SDK_ROOT/sdk.info \
Expand All @@ -86,3 +72,6 @@ RUN sed -i '/^TIZEN_SDK_DATA_PATH/d' $TIZEN_SDK_ROOT/sdk.info \
&& : # last line

ENV TIZEN_ROOTFS /tizen_rootfs

# Fast Model GDB plugins path for debugging support
ENV FAST_MODEL_PLUGINS_PATH /opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3
85 changes: 85 additions & 0 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash

#
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

HERE="$(dirname "$0")"
CHIP_ROOT="$(realpath "$HERE"/..)"
BUILD_VERSION="latest"
IMAGE_TAG="matter-dev-environment:local"
USER_UID=$UID

function show_usage() {
cat <<EOF
Usage: $0
Build vscode dev environment docker image.
Options:
-h,--help Show this help
-t,--tag Image tag - default is matter-dev-environment:local
-u,--uid User UIDa - default is the current user ID
-v,--version Build version - default is the latest
EOF
}

SHORT=t:,u:,h:,v
LONG=tag:,uid:,help:,version:
OPTS=$(getopt -n build --options "$SHORT" --longoptions "$LONG" -- "$@")

eval set -- "$OPTS"

while :; do
case "$1" in
-h | --help)
show_usage
exit 0
;;
-t | --tag)
IMAGE_TAG=$2
shift 2
;;
-u | --uid)
USER_UID=$2
shift 2
;;
-v | --version)
BUILD_VERSION=$2
shift 2
;;
--)
shift
break
;;
*)
echo "Unexpected option: $1"
show_usage
exit 2
;;
esac
done

if [ "$USER_UID" = "0" ]; then
USER_UID=1000
fi

docker build \
-t "$IMAGE_TAG" \
--pull \
--build-arg USER_UID="$USER_UID" \
--build-arg BUILD_VERSION="$BUILD_VERSION" \
--network=host \
"$HERE"
Loading

0 comments on commit 1440808

Please sign in to comment.