Configure clang-tidy CI check (#1028)

This commit is contained in:
Siarhei Fedartsou
2023-04-20 09:57:25 +02:00
committed by GitHub
parent f03deb7032
commit 2a7a6f01a2
27 changed files with 200 additions and 31 deletions

View File

@@ -17,7 +17,7 @@ std::optional<std::string> LayerFactory::getSource(const style::conversion::Conv
return std::nullopt;
}
auto const source = toString(*sourceValue);
auto source = toString(*sourceValue);
if (!source) {
return std::nullopt;
}

View File

@@ -32,7 +32,7 @@ public:
std::optional<TaggedString> formattedText;
std::optional<style::expression::Image> icon;
float sortKey = 0.0f;
std::size_t index;
std::size_t index = 0;
bool allowsVerticalWritingMode = false;
};

View File

@@ -20,7 +20,7 @@ class ResourceTransform;
namespace gfx {
class ShaderRegistry;
}
} // namespace gfx
struct StillImageRequest {
StillImageRequest(Map::StillImageCallback&& callback_)

View File

@@ -28,12 +28,10 @@
#include <mbgl/util/mat4.hpp>
#include <mapbox/eternal.hpp>
#include <mbgl/gl/context.hpp>
#include <mbgl/gl/defines.hpp>
#include <mbgl/gl/texture.hpp>
#include <mbgl/gl/texture_resource.hpp>
#include <mbgl/gl/types.hpp>
#include <mbgl/platform/gl_functions.hpp>
#include <mbgl/renderer/image_manager.hpp>
using namespace mbgl::platform;

View File

@@ -17,7 +17,6 @@
#include <mbgl/style/layers/symbol_layer_impl.hpp>
#include <mbgl/gfx/cull_face_mode.hpp>
#include <mbgl/layout/symbol_layout.hpp>
#include <mbgl/layout/symbol_layout.hpp>
#include <mbgl/util/math.hpp>
#include <cmath>

View File

@@ -403,7 +403,7 @@ public:
const float possiblyRoundedZoom = expression.useIntegerZoom ? std::floor(currentZoom) : currentZoom;
return std::tuple<float>{
::fmax(0.0f, ::fmin(1.0f, expression.interpolationFactor(zoomRange, possiblyRoundedZoom)))};
std::fmax(0.0f, std::fmin(1.0f, expression.interpolationFactor(zoomRange, possiblyRoundedZoom)))};
}
std::tuple<T> uniformValue(const PossiblyEvaluatedPropertyValue<T>& currentValue) const override {

View File

@@ -303,6 +303,7 @@ ParseResult parseMatch(const Convertible& value, ParsingContext& ctx) {
assert(inputType && outputType);
std::optional<std::string> err;
// NOLINTNEXTLINE(bugprone-assignment-in-if-condition)
if ((*input)->getType() != type::Value && (err = type::checkSubtype(*inputType, (*input)->getType()))) {
ctx.error(*err, 1);
return ParseResult();

View File

@@ -5,7 +5,6 @@
#include <mbgl/renderer/transition_parameters.hpp>
#include <mbgl/renderer/possibly_evaluated_property_value.hpp>
#include <mbgl/renderer/property_evaluation_parameters.hpp>
#include <mbgl/renderer/transition_parameters.hpp>
#include <mbgl/util/indexed_tuple.hpp>
#include <mbgl/util/ignore.hpp>

View File

@@ -19,7 +19,7 @@ OpacityState::OpacityState(bool placed_, bool skipFade)
}
OpacityState::OpacityState(const OpacityState& prevState, float increment, bool placed_) :
opacity(::fmax(0.0f, ::fmin(1.0f, prevState.opacity + (prevState.placed ? increment : -increment)))),
opacity(std::fmax(0.0f, std::fmin(1.0f, prevState.opacity + (prevState.placed ? increment : -increment)))),
placed(placed_) {}
bool OpacityState::isHidden() const {

View File

@@ -16,7 +16,7 @@ double vec4Dot(const vec4& a, const vec4& b) {
}
template <size_t N>
static Point<double> ProjectPointsToAxis(const std::array<vec3, N>& points, const vec3& origin, const vec3& axis) {
Point<double> ProjectPointsToAxis(const std::array<vec3, N>& points, const vec3& origin, const vec3& axis) {
double min = std::numeric_limits<double>::max();
double max = -std::numeric_limits<double>::max();

View File

@@ -64,7 +64,7 @@ std::map<std::string, std::string> createTokenMap(const std::string& urlTemplate
i != std::sregex_iterator();
++i)
{
std::smatch m = *i;
const std::smatch& m = *i;
if (m.size() > 0) {
auto captureGroupValue = m[1].str();
if (!captureGroupValue.empty()){
@@ -86,7 +86,7 @@ std::map<std::string, std::string> createTokenMap(const std::string& urlTemplate
i != std::sregex_iterator();
++i)
{
std::smatch m = *i;
const std::smatch& m = *i;
if (m.size() > 0) {
auto captureGroupValue = m[1].str();
if (!captureGroupValue.empty()){
@@ -152,7 +152,7 @@ bool isNormalizedURL(const TileServerOptions& tileServerOptions, const std::stri
}
std::string makeQueryString(const TileServerOptions& tileServerOptions, const std::string& apiKey) {
const std::string queryString = (!tileServerOptions.requiresApiKey() || tileServerOptions.apiKeyParameterName().empty() || apiKey.empty()) ?
std::string queryString = (!tileServerOptions.requiresApiKey() || tileServerOptions.apiKeyParameterName().empty() || apiKey.empty()) ?
"" : "?" + tileServerOptions.apiKeyParameterName() + "=" + apiKey;
return queryString;
}