Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,30 @@ Checks: >
-fuchsia*,
-llvmlibc*,
-llvm-header-guard,
-llvm-prefer-static-over-anonymous-namespace,
-misc-no-recursion,
-misc-include-cleaner,
-misc-const-correctness,
-modernize-use-trailing-return-type,
-portability-avoid-pragma-once,
-readability-redundant-access-specifiers,
-readability-convert-member-functions-to-static,
-cppcoreguidelines-avoid-const-or-ref-data-members

CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: "1"
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: 1
- key: readability-identifier-length.IgnoredVariableNames
value: '^[defijkptuvw]$'
value: "^[defijkptuvw]$"
# More options here: https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.ClassCase
value: CamelCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.VariableCase
Expand All @@ -51,14 +55,10 @@ CheckOptions:
- key: readability-identifier-naming.GlobalFunctionCase
value: lower_case
- key: readability-identifier-naming.MemberConstantCase
value: CamelCase
value: CamelCase
- key: readability-identifier-naming.StaticConstantCase
value: lower_case
value: lower_case
- key: readability-function-cognitive-complexity.Threshold
value: 10
- key: readability-function-size.ParameterThreshold
value: 4
- key: misc-include-cleaner.IgnoreHeaders
value: utility;cstddef;geode/.*_export\.h;geode/.*/common\.h;geode/basic/types\.h;geode/basic/assert\.h;


3 changes: 2 additions & 1 deletion bindings/python/src/explicit/mixin/core/fault.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

#define PYTHON_FAULT( dimension ) \
const auto name##dimension = "Fault" + std::to_string( dimension ) + "D"; \
pybind11::class_< Fault##dimension##D, Component##dimension##D > \
pybind11::class_< Fault##dimension##D, Component##dimension##D, \
pybind11::smart_holder > \
fault##dimension##D( module, name##dimension.c_str() ); \
\
pybind11::enum_< Fault##dimension##D::FAULT_TYPE >( \
Expand All @@ -43,9 +44,9 @@

namespace geode
{
void define_fault( pybind11::module& module )

Check failure on line 47 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:47:24 [clang-diagnostic-error]

use of undeclared identifier 'pybind11'
{
PYTHON_FAULT( 2 );

Check failure on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [clang-diagnostic-error]

use of undeclared identifier 'pybind11'

Check failure on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [clang-diagnostic-error]

use of undeclared identifier 'fault2D'

Check failure on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [clang-diagnostic-error]

unknown type name 'fault2D'; did you mean 'Fault2D'?

Check failure on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [clang-diagnostic-error]

unexpected type name 'Fault2D': expected expression

Check failure on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [clang-diagnostic-error]

expected expression

Check failure on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [clang-diagnostic-error]

expected ')'

Check failure on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [clang-diagnostic-error]

expected '(' for function-style cast or type construction

Check warning on line 49 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:49:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name2' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
PYTHON_FAULT( 3 );

Check failure on line 50 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:50:9 [clang-diagnostic-error]

expected ')'

Check failure on line 50 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:50:9 [clang-diagnostic-error]

expected '(' for function-style cast or type construction

Check warning on line 50 in bindings/python/src/explicit/mixin/core/fault.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault.hpp:50:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name3' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
}
} // namespace geode
4 changes: 2 additions & 2 deletions bindings/python/src/explicit/mixin/core/fault_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
#define PYTHON_FAULT_BLOCK( dimension ) \
const auto name##dimension = \
"FaultBlock" + std::to_string( dimension ) + "D"; \
pybind11::class_< FaultBlock##dimension##D, Component##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< FaultBlock##dimension##D, Component##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "component_id", &FaultBlock##dimension##D::component_id )

namespace geode
{
void define_fault_block( pybind11::module& module )
{
PYTHON_FAULT_BLOCK( 2 );

Check warning on line 37 in bindings/python/src/explicit/mixin/core/fault_block.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault_block.hpp:37:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name2' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
PYTHON_FAULT_BLOCK( 3 );

Check warning on line 38 in bindings/python/src/explicit/mixin/core/fault_block.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/fault_block.hpp:38:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name3' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
}
} // namespace geode
2 changes: 1 addition & 1 deletion bindings/python/src/explicit/mixin/core/fault_blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define PYTHON_FAULT_BLOCKS( dimension ) \
const auto name##dimension = \
"FaultBlocks" + std::to_string( dimension ) + "D"; \
pybind11::class_< FaultBlocks##dimension##D >( \
pybind11::class_< FaultBlocks##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def( "nb_fault_blocks", &FaultBlocks##dimension##D::nb_fault_blocks ) \
.def( "fault_block", &FaultBlocks##dimension##D::fault_block, \
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/explicit/mixin/core/faults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define PYTHON_FAULTS( dimension ) \
const auto name##dimension = "Faults" + std::to_string( dimension ) + "D"; \
pybind11::class_< Faults##dimension##D >( \
pybind11::class_< Faults##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def( "nb_faults", &Faults##dimension##D::nb_faults ) \
.def( "fault", &Faults##dimension##D::fault, \
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/explicit/mixin/core/horizon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#define PYTHON_HORIZON( dimension ) \
const auto name##dimension = \
"Horizon" + std::to_string( dimension ) + "D"; \
pybind11::class_< Horizon##dimension##D, Component##dimension##D > \
pybind11::class_< Horizon##dimension##D, Component##dimension##D, \
pybind11::smart_holder > \
horizon##dimension##D( module, name##dimension.c_str() ); \
\
pybind11::enum_< Horizon##dimension##D::CONTACT_TYPE >( \
Expand All @@ -48,7 +49,7 @@
{
void define_horizon( pybind11::module& module )
{
PYTHON_HORIZON( 2 );

Check warning on line 52 in bindings/python/src/explicit/mixin/core/horizon.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/horizon.hpp:52:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name2' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
PYTHON_HORIZON( 3 );

Check warning on line 53 in bindings/python/src/explicit/mixin/core/horizon.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/horizon.hpp:53:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name3' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
}
} // namespace geode
2 changes: 1 addition & 1 deletion bindings/python/src/explicit/mixin/core/horizons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define PYTHON_HORIZONS( dimension ) \
const auto name##dimension = \
"Horizons" + std::to_string( dimension ) + "D"; \
pybind11::class_< Horizons##dimension##D >( \
pybind11::class_< Horizons##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def( "nb_horizons", &Horizons##dimension##D::nb_horizons ) \
.def( "horizon", &Horizons##dimension##D::horizon, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
const auto name##dimension = \
"StratigraphicUnit" + std::to_string( dimension ) + "D"; \
pybind11::class_< StratigraphicUnit##dimension##D, \
Component##dimension##D >( module, name##dimension.c_str() ) \
Component##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def( "component_id", &StratigraphicUnit##dimension##D::component_id )

namespace geode
{
void define_stratigraphic_unit( pybind11::module& module )
{
PYTHON_STRATIGRAPHIC_UNIT( 2 );

Check warning on line 38 in bindings/python/src/explicit/mixin/core/stratigraphic_unit.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/stratigraphic_unit.hpp:38:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name2' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
PYTHON_STRATIGRAPHIC_UNIT( 3 );

Check warning on line 39 in bindings/python/src/explicit/mixin/core/stratigraphic_unit.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/explicit/mixin/core/stratigraphic_unit.hpp:39:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name3' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
}
} // namespace geode
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#define PYTHON_STRATIGRAPHIC_UNITS( dimension ) \
const auto name##dimension = \
"StratigraphicUnits" + std::to_string( dimension ) + "D"; \
pybind11::class_< StratigraphicUnits##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< StratigraphicUnits##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "nb_stratigraphic_units", \
&StratigraphicUnits##dimension##D::nb_stratigraphic_units ) \
.def( "stratigraphic_unit", \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace geode
void define_cross_section( pybind11::module& module )
{
pybind11::class_< CrossSection, Section, Faults2D, Horizons2D,
FaultBlocks2D, StratigraphicUnits2D >( module, "CrossSection" )
FaultBlocks2D, StratigraphicUnits2D, pybind11::smart_holder >(
module, "CrossSection" )
.def( pybind11::init<>() )
.def( pybind11::init( []( Section& section ) {
return CrossSection{ section.clone() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace geode
void define_structural_model( pybind11::module& module )
{
pybind11::class_< StructuralModel, BRep, Faults3D, Horizons3D,
FaultBlocks3D, StratigraphicUnits3D >( module, "StructuralModel" )
FaultBlocks3D, StratigraphicUnits3D, pybind11::smart_holder >(
module, "StructuralModel" )
.def( pybind11::init<>() )
.def( pybind11::init( []( BRep& model ) {
return StructuralModel{ model.clone() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace geode
{
void define_stratigraphic_relationships( pybind11::module& module )
{
pybind11::class_< StratigraphicRelationships >(
pybind11::class_< StratigraphicRelationships, pybind11::smart_holder >(
module, "StratigraphicRelationships" )
.def( pybind11::init<>() )
.def( "is_above", &StratigraphicRelationships::is_above )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
const auto name##dimension = \
"HorizonsStack" + std::to_string( dimension ) + "D"; \
pybind11::class_< HorizonsStack##dimension##D, StratigraphicRelationships, \
Horizons##dimension##D, StratigraphicUnits##dimension##D, \
Identifier >( module, name##dimension.c_str() ) \
Horizons##dimension##D, StratigraphicUnits##dimension##D, Identifier, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( pybind11::init<>() ) \
.def( "native_extension", \
&HorizonsStack##dimension##D::native_extension ) \
Expand Down Expand Up @@ -90,6 +90,6 @@
{
void define_horizons_stack( pybind11::module& module )
{
PYTHON_HORIZONS_STACK( 2 );

Check warning on line 93 in bindings/python/src/implicit/representation/core/horizons_stack.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/implicit/representation/core/horizons_stack.hpp:93:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name2' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
PYTHON_HORIZONS_STACK( 3 );

Check warning on line 94 in bindings/python/src/implicit/representation/core/horizons_stack.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/implicit/representation/core/horizons_stack.hpp:94:9 [bugprone-unused-local-non-trivial-variable]

unused local variable 'name3' of type 'const basic_string<char, char_traits<char>, allocator<char>>'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace geode
{
void define_implicit_cross_section( pybind11::module& module )
{
pybind11::class_< ImplicitCrossSection, CrossSection >(
module, "ImplicitCrossSection" )
pybind11::class_< ImplicitCrossSection, CrossSection,
pybind11::smart_holder >( module, "ImplicitCrossSection" )
.def( pybind11::init<>() )
.def( pybind11::init( []( CrossSection& cross_section ) {
return ImplicitCrossSection{ cross_section.clone() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace geode
{
void define_implicit_structural_model( pybind11::module& module )
{
pybind11::class_< ImplicitStructuralModel, StructuralModel >(
module, "ImplicitStructuralModel" )
pybind11::class_< ImplicitStructuralModel, StructuralModel,
pybind11::smart_holder >( module, "ImplicitStructuralModel" )
.def( pybind11::init<>() )
.def( pybind11::init( []( StructuralModel& model ) {
return ImplicitStructuralModel{ model.clone() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace geode
{
void define_stratigraphic_model( pybind11::module& module )
{
pybind11::class_< StratigraphicModel, ImplicitStructuralModel >(
module, "StratigraphicModel" )
pybind11::class_< StratigraphicModel, ImplicitStructuralModel,
pybind11::smart_holder >( module, "StratigraphicModel" )
.def( pybind11::init<>() )
.def( pybind11::init( []( ImplicitStructuralModel& model ) {
return StratigraphicModel{ model.clone() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace geode
{
void define_stratigraphic_section( pybind11::module& module )
{
pybind11::class_< StratigraphicSection, ImplicitCrossSection >(
module, "StratigraphicSection" )
pybind11::class_< StratigraphicSection, ImplicitCrossSection,
pybind11::smart_holder >( module, "StratigraphicSection" )
.def( pybind11::init<>() )
.def( pybind11::init( []( ImplicitCrossSection& cross_section ) {
return StratigraphicSection{ cross_section.clone() };
Expand Down
Loading