From 45ca8ed1779bb1667cf0e3d464e319ae33b3da47 Mon Sep 17 00:00:00 2001 From: charliebarber Date: Tue, 5 Mar 2024 14:49:25 +0000 Subject: [PATCH 1/5] Clean traces folder on run --- entrypoint.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 369c787c..6d49bcd4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,10 +1,11 @@ #!/bin/bash echo "Simulating ns3 on file: $1" +rm -rf traces/ +mkdir traces cp user_src/* scratch/ export NS_LOG=FRRQueue=level_all -./ns3 build -./ns3 run "scratch/$1" > traces/output.log 2>&1 - +./ns3 build +./ns3 run "scratch/$1" >traces/output.log 2>&1 From 8cdeaed9911d75eacb9c61e73dae5d5935fb54cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=8A=D9=88=D8=B3=D9=81?= <45167695+YousefEZ@users.noreply.github.com> Date: Wed, 6 Mar 2024 18:22:32 +0000 Subject: [PATCH 2/5] :sparkles: add format-checker.yml --- .github/workflows/format-checker.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/format-checker.yml diff --git a/.github/workflows/format-checker.yml b/.github/workflows/format-checker.yml new file mode 100644 index 00000000..5705eaf6 --- /dev/null +++ b/.github/workflows/format-checker.yml @@ -0,0 +1,19 @@ +name: clang-format Check +on: [push, pull_request] +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + strategy: + matrix: + path: + - 'src' + - 'libs' + steps: + - uses: actions/checkout@v3 + - name: Run clang-format style check for C/C++/Protobuf programs. + uses: jidicula/clang-format-action@v4.11.0 + with: + clang-format-version: '13' + check-path: ${{ matrix.path }} + fallback-style: 'Mozilla' # optional From a8a6026a634da58218f8b38bee6b08f0cf78ca0c Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Wed, 6 Mar 2024 18:23:40 +0000 Subject: [PATCH 3/5] :sparkles: add .clang-format --- .clang-format | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..7d2809d7 --- /dev/null +++ b/.clang-format @@ -0,0 +1,11 @@ +BasedOnStyle: llvm +IndentWidth: 4 +UseTab: Never +BreakBeforeBraces: Linux +SortIncludes: false +IndentCaseLabels: false +AlwaysBreakTemplateDeclarations: true +AllowShortFunctionsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: true +PointerAlignment: Left From 870e831e4b815d9379272c44aeebbc9da5ea0b8d Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Wed, 6 Mar 2024 18:24:48 +0000 Subject: [PATCH 4/5] :gears: add format script --- format.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 format.sh diff --git a/format.sh b/format.sh new file mode 100644 index 00000000..1dc19c7a --- /dev/null +++ b/format.sh @@ -0,0 +1 @@ +find . -regex '.*\.\(cpp\|hpp\|cc\|cxx\)' -exec clang-format -style=file -i {} \; From ac61816f493f2f9d738a63821b9dce22280e411b Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:57:38 +0000 Subject: [PATCH 5/5] :wrench: fix format.sh --- format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format.sh b/format.sh index 1dc19c7a..d26dc5c8 100644 --- a/format.sh +++ b/format.sh @@ -1 +1 @@ -find . -regex '.*\.\(cpp\|hpp\|cc\|cxx\)' -exec clang-format -style=file -i {} \; +find . -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)' -exec clang-format -style=file -i {} \;