Skip to content

Commit 15e7041

Browse files
committed
FIX: Fix cppcheck on GitHub
1 parent 52c9803 commit 15e7041

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ name: build
44

55
on:
66
push:
7-
branches: [main, dev]
87

98
jobs:
109
ubuntu:
@@ -20,9 +19,20 @@ jobs:
2019
- name: Checkout repository
2120
uses: actions/checkout@v3
2221
- name: Install dependencies
22+
# pcre is a dependency of cppcheck
2323
run: |
2424
sudo apt-get update
25-
sudo apt-get install cppcheck libzstd-dev ninja-build
25+
sudo apt-get install libpcre3 libpcre3-dev libzstd-dev ninja-build
26+
- name: Install cppcheck
27+
run: |
28+
git clone https://github.com/danmar/cppcheck.git
29+
cd cppcheck
30+
cmake -S. -B build \
31+
-DCMAKE_BUILD_TYPE=Release \
32+
-DUSE_MATCHCOMPILER=1 \
33+
-DHAVE_RULES=1
34+
cmake --build build --config Release
35+
sudo cmake --install build --prefix /usr
2636
- name: Install gtest
2737
uses: MarkusJx/googletest-installer@v1.1
2838
- name: CMake configure

src/historical.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@ std::vector<databento::BatchJob> Historical::BatchListJobs(
246246
throw JsonResponseError::TypeMismatch(kEndpoint, "array", json);
247247
}
248248
std::vector<BatchJob> jobs;
249-
std::transform(json.begin(), json.end(), std::back_inserter(jobs),
250-
[](const auto& item) { return ::Parse(kEndpoint, item); });
249+
std::transform(
250+
json.begin(), json.end(), std::back_inserter(jobs),
251+
[](const nlohmann::json& item) { return ::Parse(kEndpoint, item); });
251252
return jobs;
252253
}
253254

@@ -859,7 +860,7 @@ databento::SymbologyResolution Historical::SymbologyResolve(
859860
std::vector<StrMappingInterval> mapping_intervals;
860861
std::transform(mapping_json.begin(), mapping_json.end(),
861862
std::back_inserter(mapping_intervals),
862-
[](const auto& interval_json) {
863+
[](const nlohmann::json& interval_json) {
863864
return StrMappingInterval{
864865
detail::CheckedAt(kEndpoint, interval_json, "d0"),
865866
detail::CheckedAt(kEndpoint, interval_json, "d1"),

0 commit comments

Comments
 (0)