Skip to content

Commit

Permalink
Add clang format (#61)
Browse files Browse the repository at this point in the history
* add devcontainer

* intro clang-format

* add wheels
  • Loading branch information
eeliu authored Sep 20, 2023
1 parent 974a107 commit f678b57
Show file tree
Hide file tree
Showing 32 changed files with 4,513 additions and 3,030 deletions.
17 changes: 17 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Format Style Options - Created with Clang Power Tools
---
BasedOnStyle: Google
AlignAfterOpenBracket: DontAlign
AllowAllArgumentsOnNextLine: false
AllowShortBlocksOnASingleLine: Always
BreakBeforeBraces: Linux
BreakStringLiterals: false
ColumnLimit: 150
ContinuationIndentWidth: 2
IncludeBlocks: Preserve
MaxEmptyLinesToKeep: 2
ReflowComments: false
SortIncludes: false
SpaceAfterCStyleCast: true
UseTab: Always
...
1 change: 1 addition & 0 deletions .devcontainer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
devcontainer.env
36 changes: 36 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:20.04
## install developmental env
ENV TZ=Asia/Shanghai
ENV LC_CTYPE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt install -y gcc g++ gdb pkg-config libxml2-dev libsqlite3-dev libcurl4-openssl-dev zlib1g-dev make cmake wget autoconf git clangd python3-pip
## enable php-7.4
ENV PHP_VESION=php-7.4.33
RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install
ENV PATH="$PATH:/opt/php/bin/:/opt/php/sbin/"
COPY php.ini /opt/

### Build php module
### curl
# RUN cd ~/${PHP_VESION}/ext/curl && phpize && ./configure && make -j && make install
### mysqli
# RUN cd ~/php-7.4.33/ext/mysqli && phpize && ./configure && make -j && make install
### pdo
# RUN cd ~/${PHP_VESION}/ext/pdo && phpize && ./configure && make -j && make install

ENV PHP_VESION=php-5.6.30
RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install


ENV PHP_VESION=php-5.5.38
RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install

ENV PHP_VESION=php-8.0.29
RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install

ENV PHP_VESION=php-8.1.21
RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install

ENV PHP_VESION=php-8.2.10
RUN cd ~ && wget https://www.php.net/distributions/${PHP_VESION}.tar.gz && tar xvf ${PHP_VESION}.tar.gz && cd ${PHP_VESION} && ./configure --prefix=/opt/${PHP_VESION} --enable-fpm --enable-opcache --enable-debug && make -j && make install
50 changes: 50 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "PINPOINT php Dev",
"dockerFile": "Dockerfile",
"runArgs": [
// "--user=vscode",
"--cap-add=SYS_PTRACE",
"--cap-add=NET_RAW",
"--cap-add=NET_ADMIN",
"--security-opt=seccomp=unconfined",
"--volume=${env:HOME}:${env:HOME}",
// "--volume=envoy-build:/build",
"--network=host",
// Uncomment next line if you have devcontainer.env
// "--env-file=.devcontainer/devcontainer.env"
],
"containerEnv": {
"ENVOY_SRCDIR": "${containerWorkspaceFolder}",
},
// "settings": {
// "terminal.integrated.shell.linux": "/bin/bash",
// "bazel.buildifierFixOnFormat": true,
// "clangd.path": "/opt/llvm/bin/clangd",
// "python.pythonPath": "/usr/bin/python3",
// "python.formatting.provider": "yapf",
// "python.formatting.yapfArgs": [
// "--style=${workspaceFolder}/.style.yapf"
// ],
// "files.exclude": {
// "**/.clangd/**": true,
// "**/bazel-*/**": true
// },
// "files.watcherExclude": {
// "**/.clangd/**": true,
// "**/bazel-*/**": true
// }
// },
// "remoteUser": "vscode",
// "containerUser": "vscode",
"postCreateCommand": ".devcontainer/setup.sh",
"extensions": [
"github.vscode-pull-request-github",
"zxh404.vscode-proto3",
"llvm-vs-code-extensions.vscode-clangd",
"vadimcn.vscode-lldb",
"webfreak.debug",
"ms-python.python",
"xaver.clang-format",
"zxh404.vscode-proto3"
]
}
Loading

0 comments on commit f678b57

Please sign in to comment.