Skip to content

Force include order via clang-format #3909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
45 changes: 45 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,48 @@ PointerAlignment: Left
Standard: c++14
TabWidth: 2
UseTab: Never
IncludeBlocks: Regroup
IncludeCategories:
# Main PCL includes of common module should be sorted at end of PCL includes
- Regex: '^<pcl/[^/]+>$'
Priority: 100
SortPriority: 101
# All other PCL includes, which are grouped into modules
- Regex: '^<pcl/.*/.*>$'
Priority: 100
SortPriority: 100
# Major 3rd-Party components of tests & modules
- Regex: '^<gtest/'
Priority: 200
- Regex: '^<boost/'
Priority: 210
- Regex: '^<(unsupported/)?Eigen/'
Priority: 220
- Regex: '^<flann/'
Priority: 230
# Major 3rd-Party components of apps
- Regex: '^<Q[^/]+>$'
Priority: 300
- Regex: '^<ui_[^/]+\.h>$'
Priority: 300
- Regex: '^<vtk[^/]+\.h>$'
Priority: 310
# Minor 3rd-Party components
- Regex: '^<librealsense2/'
Priority: 400
- Regex: '^<(ros|message_filters)/'
Priority: 410
- Regex: '^<opencv(2)?/'
Priority: 420
- Regex: '^<tide/'
Priority: 430
- Regex: '^<thrust/'
Priority: 440
- Regex: '^<(OpenGL|(GL(UT)?/))'
Priority: 450
# Matches all std includes. Match them before any unknown include, so we can order them behind.
- Regex: '^<[a-z]+>$'
Priority: 900
# Any unknown include
- Regex: '.*'
Priority: 500
3 changes: 1 addition & 2 deletions 2d/src/examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@
* $Id$
*/

#include <pcl/point_types.h>

#include <pcl/2d/convolution.h>
#include <pcl/2d/edge.h>
#include <pcl/2d/kernel.h>
#include <pcl/2d/morphology.h>
#include <pcl/pcl_base.h>
#include <pcl/point_types.h>

using namespace pcl;

Expand Down
3 changes: 1 addition & 2 deletions ml/include/pcl/ml/densecrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@

#pragma once

#include <pcl/ml/pairwise_potential.h>
#include <pcl/memory.h>
#include <pcl/pcl_macros.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

#include <pcl/ml/pairwise_potential.h>

namespace pcl {

class PCL_EXPORTS DenseCrf {
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/dt/decision_forest.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/dt/decision_tree.h>

#include <istream>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/dt/decision_forest_evaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/dt/decision_forest.h>
#include <pcl/ml/dt/decision_tree_evaluator.h>
#include <pcl/ml/feature_handler.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/dt/decision_forest_trainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/dt/decision_forest.h>
#include <pcl/ml/dt/decision_tree.h>
#include <pcl/ml/dt/decision_tree_trainer.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/dt/decision_tree_evaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/dt/decision_tree.h>
#include <pcl/ml/feature_handler.h>
#include <pcl/ml/stats_estimator.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/dt/decision_tree_trainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/dt/decision_tree.h>
#include <pcl/ml/dt/decision_tree_data_provider.h>
#include <pcl/ml/feature_handler.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/ferns/fern_evaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/feature_handler.h>
#include <pcl/ml/ferns/fern.h>
#include <pcl/ml/stats_estimator.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/ferns/fern_trainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/feature_handler.h>
#include <pcl/ml/ferns/fern.h>
#include <pcl/ml/stats_estimator.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/impl/dt/decision_forest_evaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/dt/decision_forest.h>
#include <pcl/ml/dt/decision_forest_evaluator.h>
#include <pcl/ml/feature_handler.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/impl/dt/decision_tree_evaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/dt/decision_tree.h>
#include <pcl/ml/feature_handler.h>
#include <pcl/ml/stats_estimator.h>
Expand Down
1 change: 0 additions & 1 deletion ml/include/pcl/ml/impl/ferns/fern_evaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/feature_handler.h>
#include <pcl/ml/ferns/fern.h>
#include <pcl/ml/stats_estimator.h>
Expand Down
9 changes: 4 additions & 5 deletions ml/include/pcl/ml/kmeans.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@

#pragma once

#include <set>

#include <pcl/common/io.h>
#include <pcl/console/parse.h>
#include <pcl/console/print.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

#include <pcl/memory.h>
#include <pcl/pcl_base.h>
#include <pcl/pcl_macros.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

#include <set>

namespace pcl {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#pragma once

#include <pcl/common/common.h>

#include <pcl/ml/feature_handler.h>
#include <pcl/ml/multi_channel_2d_comparison_feature.h>
#include <pcl/ml/multi_channel_2d_data_set.h>
Expand Down
4 changes: 2 additions & 2 deletions ml/include/pcl/ml/pairwise_potential.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@

#pragma once

#include <vector>

#include <pcl/ml/permutohedral.h>

#include <vector>

namespace pcl {

class PairwisePotential {
Expand Down
14 changes: 7 additions & 7 deletions ml/include/pcl/ml/permutohedral.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@
#pragma GCC system_header
#endif

#include <boost/intrusive/hashtable.hpp>
#include <map>
#include <pcl/common/eigen.h>
#include <vector>
#include <pcl/memory.h>
#include <pcl/pcl_macros.h>

#include <boost/intrusive/hashtable.hpp>

// TODO: SWAP with Boost intrusive hash table
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <pcl/memory.h>
#include <pcl/pcl_macros.h>
#include <map>
#include <vector>

namespace pcl {

/** Implementation of a high-dimensional gaussian filtering using the permutohedral
* lattice.
*
Expand Down
6 changes: 3 additions & 3 deletions ml/include/pcl/ml/svm_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@

#pragma once

#include <pcl/common/eigen.h>
#include <pcl/ml/svm.h>

#include <cctype>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <pcl/common/eigen.h>
#include <vector>

#include <pcl/ml/svm.h>
#define Malloc(type, n) static_cast<type*>(malloc((n) * sizeof(type)))

namespace pcl {
Expand Down
3 changes: 2 additions & 1 deletion ml/src/svm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#ifndef _LIBSVM_HPP_
#define _LIBSVM_HPP_

#include <pcl/ml/svm.h>

#include <cctype>
#include <cfloat>
#include <climits>
Expand All @@ -48,7 +50,6 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <pcl/ml/svm.h>
int libsvm_version = LIBSVM_VERSION;
using Qfloat = float;
using schar = signed char;
Expand Down
3 changes: 2 additions & 1 deletion ml/src/svm_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
#ifndef PCL_SVM_WRAPPER_HPP_
#define PCL_SVM_WRAPPER_HPP_

#include <pcl/ml/svm_wrapper.h>

#include <cassert>
#include <fstream>
#include <pcl/ml/svm_wrapper.h>

char*
pcl::SVM::readline(FILE* input)
Expand Down
4 changes: 2 additions & 2 deletions octree/include/pcl/octree/impl/octree_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
#ifndef PCL_OCTREE_BASE_HPP
#define PCL_OCTREE_BASE_HPP

#include <vector>

#include <pcl/impl/instantiate.hpp>

#include <vector>

namespace pcl {
namespace octree {
//////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions octree/include/pcl/octree/impl/octree_pointcloud.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
#ifndef PCL_OCTREE_POINTCLOUD_HPP_
#define PCL_OCTREE_POINTCLOUD_HPP_

#include <cassert>

#include <pcl/common/common.h>
#include <pcl/octree/impl/octree_base.hpp>

#include <cassert>

//////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT,
typename LeafContainerT,
Expand Down
2 changes: 0 additions & 2 deletions octree/include/pcl/octree/octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@
#include <pcl/octree/octree_base.h>
#include <pcl/octree/octree_iterator.h>
#include <pcl/octree/octree_pointcloud.h>

#include <pcl/octree/octree_pointcloud_adjacency.h>
#include <pcl/octree/octree_pointcloud_changedetector.h>
#include <pcl/octree/octree_pointcloud_density.h>
#include <pcl/octree/octree_pointcloud_occupancy.h>
#include <pcl/octree/octree_pointcloud_pointvector.h>
#include <pcl/octree/octree_pointcloud_singlepoint.h>
#include <pcl/octree/octree_pointcloud_voxelcentroid.h>

#include <pcl/octree/octree_search.h>
4 changes: 2 additions & 2 deletions octree/include/pcl/octree/octree2buf_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@

#pragma once

#include <vector>

#include <pcl/octree/octree_container.h>
#include <pcl/octree/octree_iterator.h>
#include <pcl/octree/octree_key.h>
#include <pcl/octree/octree_nodes.h>
#include <pcl/pcl_macros.h>

#include <vector>

namespace pcl {
namespace octree {

Expand Down
5 changes: 3 additions & 2 deletions octree/include/pcl/octree/octree_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@

#pragma once

#include <vector>

#include <pcl/octree/octree_container.h>
#include <pcl/octree/octree_iterator.h>
#include <pcl/octree/octree_key.h>
#include <pcl/octree/octree_nodes.h>
#include <pcl/pcl_macros.h>

#include <vector>

namespace pcl {
namespace octree {

/** \brief Octree class
* \note The tree depth defines the maximum amount of octree voxels / leaf nodes (should
* be initially defined).
Expand Down
4 changes: 2 additions & 2 deletions octree/include/pcl/octree/octree_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

#pragma once

#include <vector>

#include <cassert>
#include <cstddef>
#include <vector>

namespace pcl {
namespace octree {

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/** \brief @b Octree container class that can serve as a base to construct own leaf node
* container classes.
Expand Down
3 changes: 1 addition & 2 deletions octree/include/pcl/octree/octree_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@

#pragma once

#include <pcl/octree/octree.h>

#include <pcl/octree/impl/octree2buf_base.hpp>
#include <pcl/octree/impl/octree_base.hpp>
#include <pcl/octree/impl/octree_iterator.hpp>
#include <pcl/octree/impl/octree_pointcloud.hpp>
#include <pcl/octree/impl/octree_search.hpp>
#include <pcl/octree/octree.h>
Loading