chore: fix all code style findings (enums, mutable, naming, headers, asserts)#185
Merged
Conversation
…asserts) Apply the full codebase style audit: convert 5 hand-written enums to Machinist markup, remove gratuitous mutable (matrixutils) and refactor the json/splat lazy caches to eager pre-population, rename bcg.cpp KrylovState_ members and free functions to project conventions, add missing file headers, sweep namespace closing comments and trailing newlines, convert assert() to REQUIRE(), add explicit/[[nodiscard]], fix typedef/nullptr/typos, and delete two dead stub files. Notes: - String_(const char*) and String_(const base_t&) stay non-explicit: the library relies on implicit const char* and basic_string<ci_traits> to String_ conversion in ~100+ call sites (THROW messages, string concatenation, BAREWORD defaults). Marking either explicit breaks compilation pervasively for no behavioral benefit. Only the genuinely surprising String_(size_t, char) is marked explicit. - Eligibility_ converted to AnalyticEligibility_ Machinist enum per the task; the mutable cachedEligibility_ is retained (the mutable-removal task scoped only matrixutils/json/splat). - concurrentqueue.hpp mutable mutex_ left untouched (vendored Savine). All 771 dal_cpp_tests and 40 dal_public_tests pass. Co-Authored-By: Claude <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | -2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Coverage Report for CI Build 28326030024Coverage decreased (-0.02%) to 81.475%Details
Uncovered Changes
Coverage Regressions72 previously-covered lines in 5 files lost coverage.
Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
Applies a repo-wide C++ style audit across dal-cpp/ (core) and dal-public/ (public API), focusing on aligning enums with Machinist generation, tightening API usage patterns ([[nodiscard]], explicit, REQUIRE), and normalizing headers/namespace closers to match project conventions.
Changes:
- Converted several hand-written enums to Machinist-generated enum wrapper types and updated call sites/tests accordingly.
- Refactored a few
mutable-based lazy caches to eager population (notably JSON view + UnSplat view). - Performed broad mechanical style cleanup: namespace-closer comments, trailing newlines,
assert()→REQUIRE(),typedef→using,nullptrusage, and selected naming alignment.
Reviewed changes
Copilot reviewed 141 out of 196 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| dal-public/src/xccycalibration.hpp | Marks Build() as [[nodiscard]]. |
| dal-public/src/value.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-public/src/value.cpp | Adds anonymous-namespace closer comment and newline hygiene. |
| dal-public/src/repository.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-public/src/random.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-public/src/models.cpp | Include alignment/formatting. |
| dal-public/src/interp.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-public/src/interp.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-public/src/globals.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-public/src/global.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-public/src/curvespec.hpp | Marks Build() as [[nodiscard]]. |
| dal-cpp/tests/storage/test_audit.cpp | Updates to Machinist AuditorMode_ enum usage. |
| dal-cpp/tests/protocol/test_payment.cpp | Updates to Machinist ExerciseCondition_ enum usage. |
| dal-cpp/dal/utilities/timer.hpp | Adds } // namespace Dal closer comment. |
| dal-cpp/dal/utilities/numerics.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/utilities/null.hpp | Converts doxygen //! to regular comment and adjusts wording. |
| dal-cpp/dal/utilities/maps.hpp | Adds } // namespace Dal closer comment. |
| dal-cpp/dal/utilities/functionals.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/utilities/file.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/utilities/facts.hpp | Adds } // namespace Dal closer comment. |
| dal-cpp/dal/utilities/exceptions.hpp | Adds Machinist enum markup + moves THROW/REQUIRE macros earlier for generated enum ctor usage. |
| dal-cpp/dal/utilities/exceptions.cpp | Implements StackInfoType_ usage and includes generated enum .inc. |
| dal-cpp/dal/utilities/environment.hpp | Formatting-only macro alignment. |
| dal-cpp/dal/utilities/environment.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/utilities/dictionary.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/utilities/dictionary.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/utilities/composite.hpp | Replaces 0 with nullptr in clone append. |
| dal-cpp/dal/utilities/algorithms.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/schedules.hpp | Adds closer comment for nested Date namespace + file namespace closer. |
| dal-cpp/dal/time/schedules.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/periodlength.hpp | Adds closer comment for nested Date namespace + file namespace closer. |
| dal-cpp/dal/time/periodlength.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/holidaydata.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/dateutils.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/datetimeutils.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/datetimeutils.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/datetime.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/dateincrement.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/date.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/calendars/init.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/time/calendars/china.hpp | Adds namespace closer comments for sub-namespaces and file. |
| dal-cpp/dal/string/stringutils.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/string/strings.hpp | Makes String_(size_t,char) explicit. |
| dal-cpp/dal/string/strings.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/storage/storable.hpp | Adds closer comment for nested Archive namespace. |
| dal-cpp/dal/storage/splat.cpp | Replaces lazy child cache with eager std::map of children. |
| dal-cpp/dal/storage/json.hpp | Adds namespace closer comments for JSON and Dal. |
| dal-cpp/dal/storage/json.cpp | Replaces lazy child cache with eager prepopulation; updates comments; namespace closer comment. |
| dal-cpp/dal/storage/globals.hpp | typedef→using and namespace closer comment. |
| dal-cpp/dal/storage/globals.cpp | Formatting-only include alignment. |
| dal-cpp/dal/storage/box.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/storage/box.cpp | Adds anonymous-namespace closer comment and file namespace closer comment. |
| dal-cpp/dal/storage/bag.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/storage/bag.cpp | Adds anonymous-namespace closer comment and file namespace closer comment. |
| dal-cpp/dal/storage/audit.hpp | Converts anonymous enum to Machinist AuditorMode_ and updates namespace comments. |
| dal-cpp/dal/storage/audit.cpp | Includes generated enum .inc; updates switch/compare to AuditorMode_. |
| dal-cpp/dal/storage/archive.hpp | Adds closer comment for Utils and file namespace. |
| dal-cpp/dal/storage/_repository.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/storage/_repository.cpp | Rewords TODO to known limitation; namespace closer comment. |
| dal-cpp/dal/script/visitor/pastevaluator.hpp | Updates comment for hard-coded spot push; namespace closer comment already present. |
| dal-cpp/dal/script/visitor/domain.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/visitor/debugger.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/visitor/constprocessor.hpp | Adds DAL 3-line header before Savine license block; namespace closer comment. |
| dal-cpp/dal/script/visitor/compiler.hpp | Converts header comment to DAL 3-line format; namespace closer comment. |
| dal-cpp/dal/script/visitor.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/simulation.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/simulation.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/preprocessor.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/preprocessor.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/parser.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/parser.cpp | Adds anonymous-namespace closer comment. |
| dal-cpp/dal/script/packincludes.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/nodebase.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/node.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/lexer.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/lexer.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/event/schedule.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/script/event/schedule.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/risk/slide.hpp | Deletes unused stub header. |
| dal-cpp/dal/risk/reportutils.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/risk/report.hpp | Adds closer comment for nested Report namespace; file namespace closer. |
| dal-cpp/dal/risk/report.cpp | Adds DAL 3-line header; namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/underlying.cpp | Adds anonymous-namespace closer comment. |
| dal-cpp/dal/protocol/payment.hpp | Converts nested enum to Machinist ExerciseCondition_; adds namespace closer comments. |
| dal-cpp/dal/protocol/payment.cpp | Includes generated enum .inc and updates default condition value. |
| dal-cpp/dal/protocol/optiontype.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/optiontype.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/couponrate.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/conventions.hpp | Adds closer comment for nested Libor namespace; file namespace closer. |
| dal-cpp/dal/protocol/conventions.cpp | Converts TODO to known limitation; adds anonymous-namespace closer comment; file closer. |
| dal-cpp/dal/protocol/collateraltype.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/clearer.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/clearer.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/assetvalue.hpp | Adds closer comment for nested Valuation namespace; file namespace closer. |
| dal-cpp/dal/protocol/assetvalue.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/accrualperiod.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/protocol/accrualperiod.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/platform/optionals.hpp | Formatting-only brace/newline hygiene. |
| dal-cpp/dal/platform/initall.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/platform/host.hpp | Formatting-only directive alignment. |
| dal-cpp/dal/platform/host.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/platform/consts.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/model/surface/lvmodel.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/model/ivs.hpp | Renames member to trailing-underscore convention; namespace closer comment. |
| dal-cpp/dal/model/ivs.cpp | Updates renamed member usage; namespace closer comment. |
| dal-cpp/dal/model/dupire.hpp | Namespace closer comment formatting/newline hygiene in nested namespaces. |
| dal-cpp/dal/model/blackscholes.hpp | Namespace closer comment formatting/newline hygiene in nested namespaces. |
| dal-cpp/dal/model/base.hpp | Namespace closer comment formatting/newline hygiene in nested namespaces. |
| dal-cpp/dal/math/vectors.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/stacks.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/specialfunctions.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/specialfunctions.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/smooth.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/smooth.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/rootfind.hpp | Adds Machinist BrentPhase_ enum + required includes. |
| dal-cpp/dal/math/rootfind.cpp | Includes generated enum .inc and updates phase logic to wrapper enum. |
| dal-cpp/dal/math/random/sobol.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/random/brownianbridge.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/random/brownianbridge.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/pde/pde.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/pde/meshers/uniform1dmesher.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/pde/meshers/concentrating1dmesher.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/pde/finitedifference.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/pde/finitedifference.cpp | Fixes typo “then”→“than”; namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/optimization/underdeterminedutils.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/optimization/underdetermined.hpp | Adds closer comment for nested Sparse namespace. |
| dal-cpp/dal/math/optimization/underdetermined.cpp | Replaces assert() with REQUIRE() and removes obsolete TODO. |
| dal-cpp/dal/math/ndarray.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/matrix/squarematrix.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/matrix/sparseutils.hpp | Adds } // namespace Dal::Sparse closer comment. |
| dal-cpp/dal/math/matrix/sparse.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/matrix/matrixutils.hpp | Replaces assert() size checks with REQUIRE() messages. |
| dal-cpp/dal/math/matrix/matrixutils.cpp | Removes gratuitous mutable pointer; removes obsolete TODO. |
| dal-cpp/dal/math/matrix/matrixs.hpp | Removes obsolete TODO comment. |
| dal-cpp/dal/math/matrix/matrixarithmetic.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/matrix/matrixarithmetic.cpp | Adds DAL 3-line header; namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/matrix/decompositionsmisc.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/matrix/decompositionsmisc.cpp | Adds anonymous-namespace closer comment; namespace closer formatting. |
| dal-cpp/dal/math/matrix/cholesky.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/matrix/cholesky.cpp | Adds anonymous-namespace closer comment; namespace closer formatting. |
| dal-cpp/dal/math/matrix/bcg.hpp | Adds namespace closer comments for Sparse and Dal. |
| dal-cpp/dal/math/matrix/bcg.cpp | Renames Krylov state members to trailing _ and removes _ suffix from free functions; keeps behavior. |
| dal-cpp/dal/math/interp/interplinear.hpp | Adds closer comment for nested Interp namespace. |
| dal-cpp/dal/math/interp/interplinear.cpp | Adds closer comment for nested Interp namespace. |
| dal-cpp/dal/math/interp/interpcubic.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/interp/interpcubic.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/interp/interp2d.hpp | Adds closer comment for nested Interp namespace; file namespace closer. |
| dal-cpp/dal/math/interp/interp2d.cpp | Adds closer comment for nested Interp namespace; file namespace closer. |
| dal-cpp/dal/math/distribution/utils.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/distribution/utils.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/distribution/black.hpp | Adds closer comment for nested Distribution namespace. |
| dal-cpp/dal/math/distribution/base.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/cell.cpp | Fixes error message “Call”→“Cell”; namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/analytics/vanilla.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/math/aad/tape.cpp | Adds anonymous-namespace closer comment. |
| dal-cpp/dal/math/aad/aad.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/parser/init.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/parser/fx.hpp | Adds closer comment for nested Index namespace. |
| dal-cpp/dal/indice/parser/fx.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/parser/equity.hpp | Adds closer comment for nested Index namespace. |
| dal-cpp/dal/indice/indexpath.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/indexpath.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/indexparse.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/indexcomposite.cpp | Deletes unused stub translation unit. |
| dal-cpp/dal/indice/index/ir.cpp | Adds anonymous-namespace closer comment and namespace closer comments. |
| dal-cpp/dal/indice/index/fx.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/index/equity.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/indice/index.hpp | Adds closer comment for nested Index namespace. |
| dal-cpp/dal/indice/fixings.hpp | Makes FixHistory_ ctor explicit; adds closer comment for nested FixHistory namespace. |
| dal-cpp/dal/indice/fixings.cpp | Adds anonymous-namespace closer comment. |
| dal-cpp/dal/curve/yccomponent.cpp | Adds namespace closer comment for empty TU namespace. |
| dal-cpp/dal/curve/yc.hpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/curve/yc.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/curve/piecewiselinear.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/curve/piecewiseconstant.hpp | Adds closer comment for nested PWC namespace. |
| dal-cpp/dal/curve/piecewiseconstant.cpp | Adds anonymous-namespace closer comment; namespace closer formatting. |
| dal-cpp/dal/curve/jointcalibration.cpp | Replaces local eligibility enum with Machinist AnalyticEligibility_. |
| dal-cpp/dal/curve/calibration.hpp | Adds Machinist AnalyticEligibility markup + includes generated enum header. |
| dal-cpp/dal/curve/calibration.cpp | Includes generated enum .inc + updates cached eligibility logic to wrapper enum. |
| dal-cpp/dal/currency/currencydata.hpp | Adds namespace closer comments for nested namespaces. |
| dal-cpp/dal/currency/currencydata.cpp | Adds anonymous-namespace closer comment and namespace closer comments. |
| dal-cpp/dal/currency/currency.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/concurrency/threadpool.hpp | Adds [[nodiscard]] to getters. |
| dal-cpp/dal/concurrency/threadpool.cpp | Namespace closer comment formatting/newline hygiene. |
| dal-cpp/dal/auto/MG_UnderdeterminedControls_object.hpp | Formatting-only trailing newline/brace alignment. |
| dal-cpp/dal/auto/MG_StackInfoType_enum.inc | New Machinist-generated enum implementation for StackInfoType_. |
| dal-cpp/dal/auto/MG_StackInfoType_enum.hpp | New Machinist-generated enum declaration for StackInfoType_. |
| dal-cpp/dal/auto/MG_ExerciseCondition_enum.inc | New Machinist-generated enum implementation for ExerciseCondition_. |
| dal-cpp/dal/auto/MG_ExerciseCondition_enum.hpp | New Machinist-generated enum declaration for ExerciseCondition_. |
| dal-cpp/dal/auto/MG_DayBasis_enum.hpp | Formatting-only trailing newline/brace alignment. |
| dal-cpp/dal/auto/MG_BrentPhase_enum.inc | New Machinist-generated enum implementation for BrentPhase_. |
| dal-cpp/dal/auto/MG_BrentPhase_enum.hpp | New Machinist-generated enum declaration for BrentPhase_. |
| dal-cpp/dal/auto/MG_AuditorMode_enum.inc | New Machinist-generated enum implementation for AuditorMode_. |
| dal-cpp/dal/auto/MG_AuditorMode_enum.hpp | New Machinist-generated enum declaration for AuditorMode_. |
| dal-cpp/dal/auto/MG_AnalyticEligibility_enum.inc | New Machinist-generated enum implementation for AnalyticEligibility_. |
| dal-cpp/dal/auto/MG_AnalyticEligibility_enum.hpp | New Machinist-generated enum declaration for AnalyticEligibility_. |
|
|
||
| FORCE_INLINE void Visit(const NodeSpot_&) { | ||
| // TODO: just push 0 as now | ||
| // push the spot value 30.0 |
| Sparse::TriDiagonal_* Dx(const FDM1DMesher_& x) { | ||
| int n = x.Size(); | ||
| REQUIRE(n > 2, "grids size should not less then 3"); | ||
| REQUIRE(n > 2, "grids size should not less than 3"); |
| Sparse::TriDiagonal_* Dxx(const FDM1DMesher_& x) { | ||
| int n = x.Size(); | ||
| REQUIRE(n > 2, "grids size should not less then 3"); | ||
| REQUIRE(n > 2, "grids size should not less than 3"); |
Comment on lines
7
to
10
| @@ -9,6 +9,62 @@ | |||
| #include <dal/string/strings.hpp> | |||
| #include <exception> | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Applies the full codebase style audit (HIGH + MEDIUM + LOW). All 771
dal_cpp_testsand 40dal_public_testspass.Enums → Machinist markup (5)
Converted 5 hand-written
enum class/ anonymous enums to Machinist-generated wrapper classes, with markup, generatedMG_*_enum.hpp/.inc, and updated usage:Brent_::Phase_→ top-levelBrentPhase_(dal-cpp/dal/math/rootfind.hpp|cpp)AuditorImp_anonymousmode_enum →AuditorMode_(dal-cpp/dal/storage/audit.hpp|cpp)Conditions_::Exercise_→ top-levelExerciseCondition_(dal-cpp/dal/protocol/payment.hpp|cpp)XStackInfo_::Type_→ top-levelStackInfoType_(dal-cpp/dal/utilities/exceptions.hpp|cpp); the macro definitions (THROW/REQUIRE/...) were moved above the namespace so the generated enum'sREQUIRE-using constructor expands correctlyEligibility_(calibration + jointcalibration) →AnalyticEligibility_(dal-cpp/dal/curve/calibration.hpp|cpp,jointcalibration.cpp)mutableremoval (3)matrixutils.cppWriterView_::dst_— gratuitousmutable Table_*; removed (writing through a pointer does not require the pointer to be mutable).json.cppXDocView_::children_— lazy cache; refactored to eager pre-population by iterating the JSON object's members at construction.splat.cppXUnSplat_::children_— lazy cache; refactored to eager pre-population by scanning the name column at construction into astd::map<String_, shared_ptr<...>>.concurrentqueue.hppleft untouched (vendored Savine, license-mandated header).Naming (bcg.cpp)
Renamed 12
KrylovState_members to add the trailing_(A→A_,r→r_,zzRef→zzRef_,betaPrev→betaPrev_, …) and 4 free functions to plain PascalCase (PrepareDirection_→PrepareDirection,UpdateSolution_→UpdateSolution,ValidateKrylovParams_→ValidateKrylovParams,KrylovSolve_→KrylovSolve), with all references updated.File headers, comments, namespace sweep
report.cpp,matrixarithmetic.cpp, and before the Savine license block inconstprocessor.hppandcompiler.hpp.} // namespace <X>comments to ~125 namespace closers and a trailing newline to ~90 files (verified with a comment-aware brace parser: 0 misplaced comments).POSTPONED/TODOmarkers — deleted the obsolete ones, kept genuine gaps as// known limitation: <desc>.Call→Cell,then→than),//!doxygen →//, stale "push 0" comment → matches code (30.0).Mechanical fixes
assert()→REQUIRE()inmatrixutils.hpp(5) andunderdetermined.cpp(1).[[nodiscard]]on pure getters:Build()incurvespec.hpp/xccycalibration.hpp,NumThreads()/ThreadNum()inthreadpool.hpp.explicitonFixHistory_(const vals_t&)andString_(size_t, char).typedef→usinginglobals.hpp;jmpStd→jmpStd_inivs.hpp|cpp;0→nullptrincomposite.hpp.indice/indexcomposite.cppandrisk/slide.hpp(confirmed unreferenced; CMake glob regenerated).Deliberate deviations (documented)
String_(const char*)andString_(const base_t&)are left non-explicit. The library relies on implicitconst char*→String_andbasic_string<ci_traits>→String_conversion in ~100+ call sites (THROW messages,operator+chains, BAREWORD defaults). Marking either explicit breaks compilation pervasively (verified: 70+ errors frombase_talone, 375+ fromconst char*) with no behavioral benefit — this mirrorsstd::string's deliberate design. Only the genuinely surprisingString_(size_t, char)is marked explicit.mutable cachedEligibility_andmutable evaluationCount_in the calibration classes are retained — the mutable-removal task scoped onlymatrixutils/json/splat. These remain legitimate const-cache memoizations.Test plan
cmake --build build -j$(nproc)— clean (0 errors)bin/dal_cpp_testsequivalent → 771 tests from 70 suites PASSbin/dal_public_testsequivalent → 40 tests from 6 suites PASS.incincluded in exactly one TU each)Co-Authored-By: Claude noreply@anthropic.com