Skip to content

Commit

Permalink
Add suppressions for clang-tidy-14 (#1454)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Aug 25, 2022
2 parents 3a94f64 + 1c71a0e commit 867361b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Checks: >
-*,
bugprone-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
clang-analyzer-*,
Expand All @@ -22,6 +24,7 @@ Checks: >
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
Expand All @@ -36,6 +39,7 @@ Checks: >
modernize-*,
-modernize-avoid-c-arrays,
-modernize-make-shared,
-modernize-return-braced-init-list,
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
Expand All @@ -50,6 +54,7 @@ Checks: >
-readability-magic-numbers,
-readability-named-parameter,
-readability-simplify-boolean-expr,
-readability-suspicious-call-argument,
-readability-use-anyofallof,
HeaderFilterRegex: '.*'
FormatStyle: file
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy-12 libboost-dev
sudo apt-get install -y clang-tidy-14 libboost-dev
- name: Check
run: |
cmake --preset linux-ci-build-with-clang-tidy
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"BOOST_ROOT": "/usr",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_COMPILER": "g++",
"QL_CLANG_TIDY": "clang-tidy-12",
"QL_CLANG_TIDY": "clang-tidy-14",
"QL_CLANG_TIDY_OPTIONS": "-quiet;-fix",
"QL_USE_CLANG_TIDY": "ON",
"QL_USE_STD_CLASSES": "ON"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace QuantLib {
const StochasticProcess& process,
const TimeGrid& grid)
: arguments_(args), vanilla_(arguments_, process, grid) {
QL_REQUIRE(args.exercise->dates().size(), "specify at least one stopping date");
QL_REQUIRE(!args.exercise->dates().empty(), "specify at least one stopping date");

stoppingTimes_.resize(args.exercise->dates().size());
for (Size i=0; i<stoppingTimes_.size(); ++i) {
Expand Down
1 change: 0 additions & 1 deletion ql/experimental/math/latentmodel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ namespace QuantLib {
// this class template always to be fully specialized:
private:
IntegrationBase() = default;
~IntegrationBase() override = default;
};
//@}

Expand Down
2 changes: 0 additions & 2 deletions ql/models/shortrate/onefactormodels/gaussian1dmodel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ class Gaussian1dModel : public TermStructureConsistentModel, public LazyObject {
registerWith(Settings::instance().evaluationDate());
}

~Gaussian1dModel() override = default;

virtual Real numeraireImpl(Time t, Real y, const Handle<YieldTermStructure>& yts) const = 0;

virtual Real
Expand Down
2 changes: 1 addition & 1 deletion ql/pricingengines/barrier/discretizedbarrieroption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace QuantLib {
const StochasticProcess& process,
const TimeGrid& grid)
: arguments_(args), vanilla_(arguments_, process, grid) {
QL_REQUIRE(args.exercise->dates().size(), "specify at least one stopping date");
QL_REQUIRE(!args.exercise->dates().empty(), "specify at least one stopping date");

stoppingTimes_.resize(args.exercise->dates().size());
for (Size i=0; i<stoppingTimes_.size(); ++i) {
Expand Down
4 changes: 2 additions & 2 deletions ql/pricingengines/swaption/basketgeneratingengine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ namespace QuantLib {
MaturityStrikeByDeltaGamma
} CalibrationBasketType;

virtual ~BasketGeneratingEngine() = default;

std::vector<ext::shared_ptr<BlackCalibrationHelper>>
calibrationBasket(const ext::shared_ptr<Exercise>& exercise,
const ext::shared_ptr<SwapIndex>& standardSwapBase,
Expand All @@ -81,8 +83,6 @@ namespace QuantLib {
: onefactormodel_(std::move(model)), oas_(std::move(oas)),
discountCurve_(std::move(discountCurve)) {}

virtual ~BasketGeneratingEngine() = default;

virtual Real underlyingNpv(const Date& expiry, Real y) const = 0;

virtual Swap::Type underlyingType() const = 0;
Expand Down

0 comments on commit 867361b

Please sign in to comment.