Skip to content

Commit

Permalink
// temp changes just for check clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
dpasukhi committed Aug 25, 2024
1 parent 43f45c0 commit 0b965fa
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/clang-tidy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Insecure workflow with limited permissions that should provide analysis results through an artifact
name: Static analysis

on: pull_request

jobs:
clang-tidy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Fetch base branch
run: |
git remote add upstream "https://github.com/${{ github.event.pull_request.base.repo.full_name }}"
git fetch --no-tags --no-recurse-submodules upstream "${{ github.event.pull_request.base.ref }}"
- name: Install clang-tidy

run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang clang-tidy make libbtbb-dev libx11-dev libglu1-mesa-dev

- name: Prepare compile_commands.json
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++ \
-D USE_FREETYPE=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
- name: Create results directory
run: |
mkdir clang-tidy-result
- name: Analyze
run: |
git diff -U0 "$(git merge-base HEAD "upstream/${{ github.event.pull_request.base.ref }}")" | clang-tidy-diff -p1 -path build -export-fixes clang-tidy-result/fixes.yml
- name: Save PR metadata
run: |
echo "${{ github.event.number }}" > clang-tidy-result/pr-id.txt
echo "${{ github.event.pull_request.head.repo.full_name }}" > clang-tidy-result/pr-head-repo.txt
echo "${{ github.event.pull_request.head.sha }}" > clang-tidy-result/pr-head-sha.txt
- uses: actions/upload-artifact@v4
with:
name: clang-tidy-result
path: clang-tidy-result/
2 changes: 2 additions & 0 deletions src/HLRTest/HLRTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Standard_Boolean HLRTest::GetProjector (Standard_CString& Name,
Handle(HLRTest_Projector) HP =
Handle(HLRTest_Projector)::DownCast(Draw::Get(Name));
if (HP.IsNull()) return Standard_False;
HP.Nullify();
HP = nullptr;
P = HP->Projector();
return Standard_True;

Expand Down
1 change: 1 addition & 0 deletions src/HLRTest/HLRTest_OutLiner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Handle(Draw_Drawable3D) HLRTest_OutLiner::Copy () const
Handle(HLRTest_OutLiner) O =
new HLRTest_OutLiner(myOutLiner->OriginalShape());
return O;
return nullptr;
}

//=======================================================================
Expand Down

0 comments on commit 0b965fa

Please sign in to comment.