Skip to content

Commit

Permalink
FIX: Fix cppcheck on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Jul 11, 2023
1 parent 52c9803 commit 15e7041
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ name: build

on:
push:
branches: [main, dev]

jobs:
ubuntu:
Expand All @@ -20,9 +19,20 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
# pcre is a dependency of cppcheck
run: |
sudo apt-get update
sudo apt-get install cppcheck libzstd-dev ninja-build
sudo apt-get install libpcre3 libpcre3-dev libzstd-dev ninja-build
- name: Install cppcheck
run: |
git clone https://github.com/danmar/cppcheck.git
cd cppcheck
cmake -S. -B build \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_MATCHCOMPILER=1 \
-DHAVE_RULES=1
cmake --build build --config Release
sudo cmake --install build --prefix /usr
- name: Install gtest
uses: MarkusJx/[email protected]
- name: CMake configure
Expand Down
7 changes: 4 additions & 3 deletions src/historical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,9 @@ std::vector<databento::BatchJob> Historical::BatchListJobs(
throw JsonResponseError::TypeMismatch(kEndpoint, "array", json);
}
std::vector<BatchJob> jobs;
std::transform(json.begin(), json.end(), std::back_inserter(jobs),
[](const auto& item) { return ::Parse(kEndpoint, item); });
std::transform(
json.begin(), json.end(), std::back_inserter(jobs),
[](const nlohmann::json& item) { return ::Parse(kEndpoint, item); });
return jobs;
}

Expand Down Expand Up @@ -859,7 +860,7 @@ databento::SymbologyResolution Historical::SymbologyResolve(
std::vector<StrMappingInterval> mapping_intervals;
std::transform(mapping_json.begin(), mapping_json.end(),
std::back_inserter(mapping_intervals),
[](const auto& interval_json) {
[](const nlohmann::json& interval_json) {
return StrMappingInterval{
detail::CheckedAt(kEndpoint, interval_json, "d0"),
detail::CheckedAt(kEndpoint, interval_json, "d1"),
Expand Down

0 comments on commit 15e7041

Please sign in to comment.