Fix get_lots_from_dir in rootly path case #17
Triggered via pull request
February 27, 2024 18:16
jhiemstrawisc
opened
#17
Status
Success
Total duration
37s
Artifacts
–
Annotations
1 error and 2 warnings
Run linters
This action does not have permission to push to forks. You may want to run it only on `push` events.
|
Run linters:
src/lotman_internal.cpp#L1821
[lint] reported by reviewdog 🐶
Raw Output:
src/lotman_internal.cpp:1821:-std::pair<std::vector<std::string>, std::string> lotman::Lot::get_lots_from_dir(std::string dir, const bool recursive) {
src/lotman_internal.cpp:1822:- if (dir.back() == '/') { // Remove the character
src/lotman_internal.cpp:1823:- if (dir.length() > 1) {
src/lotman_internal.cpp:1824:- dir.pop_back();
src/lotman_internal.cpp:1825:- }
src/lotman_internal.cpp:1826:- }
src/lotman_internal.cpp:1827:-
src/lotman_internal.cpp:1828:- std::string lots_from_dir_query = "SELECT lot_name FROM paths "
src/lotman_internal.cpp:1829:- "WHERE "
src/lotman_internal.cpp:1830:- "(path = ? OR ? LIKE path || '/%') " // The incoming file path is either the stored file path or a subdirectory of it
src/lotman_internal.cpp:1831:- "AND "
src/lotman_internal.cpp:1832:- "(recursive OR path = ?) " // If the stored file path is not recursive, we only match the exact file path
src/lotman_internal.cpp:1833:- "ORDER BY LENGTH(path) DESC LIMIT 1;"; // We prefer longer matches over shorter ones
src/lotman_internal.cpp:1834:- std::map<std::string, std::vector<int>> dir_str_map{{dir, {1,2,3}}};
src/lotman_internal.cpp:1835:- auto rp = lotman::Checks::SQL_get_matches(lots_from_dir_query, dir_str_map);
src/lotman_internal.cpp:1836:- if (!rp.second.empty()) {
src/lotman_internal.cpp:1837:- std::string int_err = rp.second;
src/lotman_internal.cpp:1838:- std::string ext_err = "Failure on call to SQL_get_matches: ";
src/lotman_internal.cpp:1839:- return std::make_pair(std::vector<std::string>(), ext_err + int_err);
src/lotman_internal.cpp:1840:- }
src/lotman_internal.cpp:2154:+std::pair<std::vector<std::string>, std::string>
src/lotman_internal.cpp:2155:+lotman::Lot::get_lots_from_dir(std::string dir, const bool recursive) {
src/lotman_internal.cpp:2156:+ if (dir.back() == '/') { // Remove the character
src/lotman_internal.cpp:2157:+ if (dir.length() > 1) {
src/lotman_internal.cpp:2158:+ dir.pop_back();
src/lotman_internal.cpp:2159:+ }
src/lotman_internal.cpp:2160:+ }
src/lotman_internal.cpp:2161:+
src/lotman_internal.cpp:2162:+ std::string lots_from_dir_query =
src/lotman_internal.cpp:2163:+ "SELECT lot_name FROM paths "
src/lotman_internal.cpp:2164:+ "WHERE "
src/lotman_internal.cpp:2165:+ "(path = ? OR ? LIKE path || '/%') " // The incoming file path is either
src/lotman_internal.cpp:2166:+ // the stored file path or a
src/lotman_internal.cpp:2167:+ // subdirectory of it
src/lotman_internal.cpp:2168:+ "AND "
src/lotman_internal.cpp:2169:+ "(recursive OR path = ?) " // If the stored file path is not recursive, we
src/lotman_internal.cpp:2170:+ // only match the exact file path
src/lotman_internal.cpp:2171:+ "ORDER BY LENGTH(path) DESC LIMIT 1;"; // We prefer longer matches over
src/lotman_internal.cpp:2172:+ // shorter ones
src/lotman_internal.cpp:2173:+ std::map<std::string, std::vector<int>> dir_str_map{{dir, {1, 2, 3}}};
src/lotman_internal.cpp:2174:+ auto rp = lotman::Checks::SQL_get_matches(lots_from_dir_query, dir_str_map);
src/lotman_internal.cpp:2175:+ if (!rp.second.empty()) {
src/lotman_internal.cpp:2176:+ std::string int_err = rp.second;
src/lotman_internal.cpp:2177:+ std::string ext_err = "Failure on call to SQL_get_matches: ";
src/lotman_internal.cpp:2178:+ return std::make_pair(std::vector<std::string>(), ext_err + int_err);
src/lotman_internal.cpp:2179:+ }
src/lotman_internal.cpp:2180:+
src/lotman_internal.cpp:2181:+ std::vector<std::string> matching_lots_vec;
src/lotman_internal.cpp:2182:+ if (rp.first.empty()) { // No associated lots were found, indicating the
src/lotman_internal.cpp:21
|
Run linters
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, wearerequired/lint-action@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|