Skip to content

Commit e880d54

Browse files
authored
GDV-58: [CPP] Fix order of includes. (apache#25)
* GDV-58: [CPP] Fix order of includes. Fixing the order of includes to follow style guideline. The order to follow is documented here : https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes Also enabled the check in lint.
1 parent 689a39e commit e880d54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+104
-52
lines changed

src/gandiva/src/cpp/build-support/cpplint.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4636,6 +4636,11 @@ def _ClassifyInclude(fileinfo, include, is_system):
46364636
if is_system and os.path.splitext(include)[1] in ['.hpp', '.hxx', '.h++']:
46374637
is_system = False
46384638

4639+
# Arrow and LLVM do not export .hpp headers, forcing to recognize
4640+
# that these are not c system headers.
4641+
if is_system and include.split('/')[0] in ['arrow', 'llvm', 'gtest']:
4642+
is_system = False
4643+
46394644
if is_system:
46404645
if is_cpp_h:
46414646
return _CPP_SYS_HEADER

src/gandiva/src/cpp/cmake/BuildUtils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function(add_lint)
101101
${CPPLINT_BIN}
102102
--verbose=2
103103
--linelength=90
104-
--filter=-whitespace/comments,-readability/todo,-build/header_guard,-build/c++11,-runtime/references,-build/include_order
104+
--filter=-whitespace/comments,-readability/todo,-build/header_guard,-build/c++11,-runtime/references
105105
)
106106
endif (UNIX)
107107
endfunction(add_lint)

src/gandiva/src/cpp/include/gandiva/arrow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <memory>
2020
#include <vector>
21+
2122
#include <arrow/builder.h>
2223
#include <arrow/record_batch.h>
2324
#include <arrow/type.h>

src/gandiva/src/cpp/include/gandiva/projector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <memory>
2020
#include <utility>
2121
#include <vector>
22+
2223
#include "gandiva/arrow.h"
2324
#include "gandiva/expression.h"
2425
#include "gandiva/status.h"

src/gandiva/src/cpp/include/gandiva/tree_expr_builder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <string>
2020
#include <vector>
21+
2122
#include "gandiva/expression.h"
2223

2324
namespace gandiva {

src/gandiva/src/cpp/src/codegen/annotator.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "codegen/annotator.h"
16+
1517
#include <memory>
1618
#include <string>
17-
#include "codegen/annotator.h"
19+
1820
#include "codegen/field_descriptor.h"
1921

2022
namespace gandiva {

src/gandiva/src/cpp/src/codegen/annotator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717

1818
#include <list>
1919
#include <string>
20-
#include <vector>
2120
#include <unordered_map>
21+
#include <vector>
22+
23+
#include "codegen/eval_batch.h"
2224
#include "gandiva/arrow.h"
2325
#include "gandiva/gandiva_aliases.h"
2426
#include "gandiva/logging.h"
25-
#include "codegen/eval_batch.h"
2627

2728
namespace gandiva {
2829

src/gandiva/src/cpp/src/codegen/annotator_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "codegen/annotator.h"
16+
1517
#include <memory>
16-
#include <gtest/gtest.h>
18+
1719
#include <arrow/memory_pool.h>
18-
#include "codegen/annotator.h"
20+
#include <gtest/gtest.h>
1921
#include "codegen/field_descriptor.h"
2022

2123
namespace gandiva {

src/gandiva/src/cpp/src/codegen/dex.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717

1818
#include <string>
1919
#include <vector>
20-
#include "gandiva/gandiva_aliases.h"
20+
2121
#include "codegen/dex_visitor.h"
2222
#include "codegen/field_descriptor.h"
2323
#include "codegen/func_descriptor.h"
2424
#include "codegen/literal_holder.h"
2525
#include "codegen/native_function.h"
2626
#include "codegen/value_validity_pair.h"
27+
#include "gandiva/gandiva_aliases.h"
2728

2829
namespace gandiva {
2930

src/gandiva/src/cpp/src/codegen/dex_llvm_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include <gtest/gtest.h>
15+
#include "codegen/dex.h"
16+
1617
#include <map>
1718
#include <typeinfo>
18-
#include "codegen/dex.h"
19+
20+
#include <gtest/gtest.h>
1921

2022
namespace gandiva {
2123

0 commit comments

Comments
 (0)