Skip to content

Commit 48c346a

Browse files
author
Sander Valstar
committedJul 26, 2019
adds clang-format to vscode devcontainer config
1 parent 018abd4 commit 48c346a

File tree

6 files changed

+46
-12
lines changed

6 files changed

+46
-12
lines changed
 

‎.clang-format

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# We'll use defaults from the Google style guide, but with 4 columns indentation.
22
BasedOnStyle: Google
33
IndentWidth: 4
4+
DerivePointerAlignment: false
5+
PointerAlignment: Left

‎.devcontainer/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ RUN apt-get update \
2323
#
2424
# Install clang
2525
&& apt-get -y install clang=1:7.0-47 clang-tools=1:7.0-47 clang-tidy=1:7.0-47 clang-format=1:7.0-47 \
26+
#
27+
# Install VSCode C/C++ extension's autoformat dependencies
28+
&& apt-get -y install libtinfo5 \
2629
#
2730
# Install meson tools
2831
&& pip3 install meson==0.51.1 \
@@ -39,5 +42,14 @@ RUN apt-get update \
3942
&& apt-get clean -y \
4043
&& rm -rf /var/lib/apt/lists/*
4144

45+
# Set locale
46+
RUN apt-get update \
47+
&& apt-get -y install locales \
48+
&& sed -i -r 's/# (en_US.UTF-8 UTF-8)/\1/' /etc/locale.gen \
49+
&& locale-gen \
50+
&& update-locale LANG=en_US.UTF-8
51+
52+
ENV LANG=en_US.UTF-8
53+
4254
# Switch back to dialog for any ad-hoc use of apt-get
4355
ENV DEBIAN_FRONTEND=dialog

‎.devcontainer/devcontainer.json

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
2-
"name": "C++",
3-
"extensions": ["ms-vscode.cpptools"],
4-
"settings": {
5-
"terminal.integrated.shell.linux": "/bin/bash"
6-
},
7-
"dockerComposeFile": ["docker-compose.yml"],
8-
"service": "web",
9-
"workspaceFolder": "/Code/meson_test",
10-
"shutdownAction": "stopCompose"
11-
}
2+
"name": "C++",
3+
"extensions": [
4+
"ms-vscode.cpptools"
5+
],
6+
"settings": {
7+
"terminal.integrated.shell.linux": "/bin/bash",
8+
},
9+
"dockerComposeFile": [
10+
"docker-compose.yml"
11+
],
12+
"service": "web",
13+
"workspaceFolder": "/Code/meson_test",
14+
"shutdownAction": "stopCompose"
15+
}

‎.vscode/c_cpp_properties.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"defines": [],
9+
"compilerPath": "/usr/bin/c++",
10+
"cppStandard": "c++14",
11+
"intelliSenseMode": "gcc-x64",
12+
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
13+
}
14+
],
15+
"version": 4
16+
}

‎meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ run_target('clang-tidy',
2727

2828
run_target('cppcheck', command : ['cppcheck',
2929
'--enable=all', '--std=c++14', '--error-exitcode=1', '--suppress=missingInclude',
30-
'src', 'test'])
30+
'src', 'test'])

‎src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#define PROJECT_NAME "meson_test"
66

7-
int main(int argc, char **argv) {
7+
int main(int argc, char** argv) {
88
if (argc != 1) {
99
std::cout << argv[0] << "takes no arguments.\n";
1010
return 1;

0 commit comments

Comments
 (0)
Please sign in to comment.