From 33c576f9730da83752b2211efa4752c7f7d3d9af Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 24 Jun 2025 12:48:33 +0200 Subject: Clarify use of a clang-tidy check The google-default-arguments check normally imposes that virtual methods have no default arguments. For our use-cases, all implementations of such methods are expected to use the same default arguments, and thus this check is manually disabled via NOLINT comments. However, this is not done consistently. This commit cleans this up and clarifies our intent by: - removing the default values (and the NOLINT statement) for all implementations of virtual methods with default argument values, matching the desired intended behaviour, but - keeping the clang-tidy check for future cases where derived classes would want to provide each different defaults. --- src/buildtool/execution_api/local/local_api.hpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/buildtool/execution_api/local/local_api.hpp') diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index 1b6ddeab..92761738 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -40,7 +40,6 @@ class LocalApi final : public IExecutionApi { explicit LocalApi(gsl::not_null const& local_context, RepositoryConfig const* repo_config = nullptr) noexcept; - // NOLINTNEXTLINE(google-default-arguments) [[nodiscard]] auto CreateAction( ArtifactDigest const& root_digest, std::vector const& command, @@ -49,8 +48,7 @@ class LocalApi final : public IExecutionApi { std::vector const& output_dirs, std::map const& env_vars, std::map const& properties, - bool force_legacy = false) const noexcept - -> IExecutionAction::Ptr final; + bool force_legacy) const noexcept -> IExecutionAction::Ptr final; /// \brief Create a new action (>=RBEv2.1). /// \param[in] root_digest Digest of the build root. @@ -72,20 +70,16 @@ class LocalApi final : public IExecutionApi { std::map const& properties) const noexcept -> IExecutionAction::Ptr; - // NOLINTNEXTLINE(google-default-arguments) [[nodiscard]] auto RetrieveToPaths( std::vector const& artifacts_info, std::vector const& output_paths, - IExecutionApi const* /*alternative*/ = nullptr) const noexcept - -> bool final; + IExecutionApi const* /*alternative*/) const noexcept -> bool final; - // NOLINTNEXTLINE(google-default-arguments) [[nodiscard]] auto RetrieveToFds( std::vector const& artifacts_info, std::vector const& fds, bool raw_tree, - IExecutionApi const* /*alternative*/ = nullptr) const noexcept - -> bool final; + IExecutionApi const* /*alternative*/) const noexcept -> bool final; [[nodiscard]] auto RetrieveToCas( std::vector const& artifacts_info, -- cgit v1.2.3