Skip to content

Commit

Permalink
clang-format: Fix includes sorting
Browse files Browse the repository at this point in the history
The includes sorting config is taken from Aleth with regex for C++ standard library made more restrictive. The functional change is that .h and .hpp files are now equal.
  • Loading branch information
chfast committed Aug 6, 2019
1 parent 5471f2b commit 17d3471
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
31 changes: 26 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,37 @@ BreakBeforeTernaryOperators: false
ColumnLimit: 100
ConstructorInitializerIndentWidth: 2
IncludeCategories:

# Local includes "":
- Regex: '^".*'
Priority: 1
- Regex: '^<boost.*'
Priority: 98
- Regex: '^<.*\.h>'

# Third party libraries:
- Regex: '^<cryptopp/.*'
Priority: 70

# Standard library extensions / common generic purpose libraries:
- Regex: '^<boost/.*'
Priority: 80

# Testing libraries:
- Regex: '^<benchmark/.*'
Priority: 90
- Regex: '^<gtest/.*'
Priority: 90

# Public includes <>:
- Regex: '^<.*\.h|hpp>'
Priority: 2
- Regex: '^<.*'
Priority: 99

# C++ standard library:
- Regex: '^<[^.]*>$'
Priority: 100

# Anything else:
- Regex: '.*'
Priority: 4

IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
Expand Down
2 changes: 1 addition & 1 deletion test/vmtester/vmtester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Licensed under the Apache License, Version 2.0.

#include "vmtester.hpp"
#include <evmc/loader.h>
#include <evmc/evmc.hpp>
#include <evmc/loader.h>
#include <iostream>
#include <memory>

Expand Down
2 changes: 1 addition & 1 deletion test/vmtester/vmtester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Licensed under the Apache License, Version 2.0.
#pragma once

#include <gtest/gtest.h>
#include <evmc/evmc.hpp>
#include <gtest/gtest.h>

class evmc_vm_test : public ::testing::Test
{
Expand Down

0 comments on commit 17d3471

Please sign in to comment.