Skip to content

Commit

Permalink
Force include order via clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiko Thiel committed Apr 20, 2020
1 parent 9e599c1 commit 98e3eed
Show file tree
Hide file tree
Showing 49 changed files with 145 additions and 135 deletions.
36 changes: 36 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,39 @@ PointerAlignment: Left
Standard: c++14
TabWidth: 2
UseTab: Never
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<pcl/'
Priority: 1
- Regex: '^<gtest/'
Priority: 2
- Regex: '^<boost/'
Priority: 3
- Regex: '^<(unsupported/)?Eigen/'
Priority: 4
- Regex: '^<flann/'
Priority: 5
- Regex: '^<Q[^/]+>$'
Priority: 6
- Regex: '^<ui_[^/]+\.h>$'
Priority: 6
- Regex: '^<vtk[^/]+\.h>$'
Priority: 7
- Regex: '^<librealsense2/'
Priority: 8
- Regex: '^<(ros|message_filters)/'
Priority: 9
- Regex: '^<opencv(2)?/'
Priority: 10
- Regex: '^<tide/'
Priority: 11
- Regex: '^<thrust/'
Priority: 12
- Regex: '^<(OpenGL|(GL(UT)?/))'
Priority: 13
# Matches all std includes. Match them before any unknown include, so we can order them behind.
- Regex: '^<[a-z]+>$'
Priority: 15
# Any unknown include
- Regex: '.*'
Priority: 14
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 @@ -40,12 +40,11 @@
#pragma once

#include <pcl/memory.h>
#include <pcl/ml/pairwise_potential.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>
7 changes: 3 additions & 4 deletions octree/include/pcl/octree/octree_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@

#pragma once

#include <cstddef>
#include <deque>
#include <vector>

#include <pcl/octree/octree_key.h>
#include <pcl/octree/octree_nodes.h>

#include <cstddef>
#include <deque>
#include <iterator>
#include <vector>

// Ignore warnings in the above headers
#ifdef __GNUC__
Expand Down
Loading

0 comments on commit 98e3eed

Please sign in to comment.