Skip to content

Commit 34abebf

Browse files
authored
Merge pull request #941 from PowerGridModel/feature/full-clang-tidy
Full clang-tidy
2 parents 9cf8afb + 47afd70 commit 34abebf

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
clang-tidy:
5454
uses: "./.github/workflows/clang-tidy.yml"
5555
with:
56-
target: "power_grid_model_api_tests"
56+
target: "all"
5757

5858
ci-passed:
5959
runs-on: ubuntu-latest

.github/workflows/clang-tidy.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ jobs:
6565
run: |
6666
brew install boost eigen nlohmann-json msgpack-cxx doctest
6767
68-
- name: Set build target in case of push
69-
if: inputs.target == null
70-
run: |
71-
echo "TARGET=power_grid_model_api_tests" >> $GITHUB_ENV
72-
7368
- name: Set build target in case of workflow dispatch
7469
if: inputs.target != null
7570
run: |
@@ -78,4 +73,4 @@ jobs:
7873
- name: Build
7974
run: |
8075
cmake --preset ${{ env.PRESET }}
81-
cmake --build --preset ${{ env.PRESET }} --target ${{ env.TARGET }}
76+
cmake --build --preset ${{ env.PRESET }} --target ${{ env.TARGET }} -- -k 0

.github/workflows/nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
clang-tidy:
3232
uses: "./.github/workflows/clang-tidy.yml"
3333
with:
34-
target: "all power_grid_model_benchmark_cpp"
34+
target: "all"
3535

3636
citations:
3737
uses: "./.github/workflows/citations.yml"

tests/cpp_validation_tests/test_validation.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ class UnsupportedValidationCase : public PowerGridError {
3737

3838
using nlohmann::json;
3939

40-
auto read_file(std::filesystem::path const& path) {
41-
std::ifstream const f{path};
42-
std::ostringstream buffer;
43-
buffer << f.rdbuf();
44-
return buffer.str();
45-
}
46-
4740
auto read_json(std::filesystem::path const& path) {
4841
json j;
4942
std::ifstream f{path};
@@ -77,6 +70,13 @@ OwningDataset load_dataset(std::filesystem::path const& path) {
7770
// Issue in msgpack, reported in https://github.com/msgpack/msgpack-c/issues/1098
7871
// May be a Clang Analyzer bug
7972
#ifndef __clang_analyzer__ // TODO(mgovers): re-enable this when issue in msgpack is fixed
73+
auto read_file = [](std::filesystem::path const& read_file_path) {
74+
std::ifstream const f{read_file_path};
75+
std::ostringstream buffer;
76+
buffer << f.rdbuf();
77+
return buffer.str();
78+
};
79+
8080
Deserializer deserializer{read_file(path), PGM_json};
8181
auto& writable_dataset = deserializer.get_dataset();
8282
auto dataset = create_owning_dataset(writable_dataset);

0 commit comments

Comments
 (0)