Skip to content

Commit 50e176f

Browse files
authored
style(clang-format): Re-order header include priorities so external headers appear before the project's headers; Update to clang-format v21.1 and apply the corresponding format changes. (#156)
1 parent 9e37a5d commit 50e176f

File tree

16 files changed

+44
-42
lines changed

16 files changed

+44
-42
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
# Linting config files symlinked from dev-utils
2+
/.clang-format
3+
/.clang-tidy
4+
5+
# Build related directories
16
.task/
27
build/

lint-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
clang-format>=20.1
2-
clang-tidy>=20.1
2+
clang-tidy>=21.1
33
gersemi>=0.16.2
44
yamllint>=1.35.1

src/.clang-format

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ IncludeCategories:
66

77
# Project library headers
88
- Regex: "^<log_surgeon"
9-
Priority: 3
9+
Priority: 4
1010

1111
# External library headers. Update when adding new libraries.
1212
- Regex: "^<(fmt|gsl)"
13-
Priority: 4
13+
Priority: 3
1414

1515
# C system headers
1616
- Regex: "^<.+\\.h>"
@@ -19,7 +19,3 @@ IncludeCategories:
1919
# C++ standard libraries
2020
- Regex: "^<.+>"
2121
Priority: 2
22-
23-
# Project relative headers
24-
- Regex: "^\".+\""
25-
Priority: 5

src/log_surgeon/SchemaParser.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
#include <log_surgeon/utils.hpp>
2424

2525
using ParserValueRegex = log_surgeon::ParserValue<std::unique_ptr<
26-
log_surgeon::finite_automata::RegexAST<log_surgeon::finite_automata::ByteNfaState>>>;
26+
log_surgeon::finite_automata::RegexAST<log_surgeon::finite_automata::ByteNfaState>
27+
>>;
2728
using RegexASTByte
2829
= log_surgeon::finite_automata::RegexAST<log_surgeon::finite_automata::ByteNfaState>;
2930
using RegexASTGroupByte
@@ -32,8 +33,8 @@ using RegexASTIntegerByte
3233
= log_surgeon::finite_automata::RegexASTInteger<log_surgeon::finite_automata::ByteNfaState>;
3334
using RegexASTLiteralByte
3435
= log_surgeon::finite_automata::RegexASTLiteral<log_surgeon::finite_automata::ByteNfaState>;
35-
using RegexASTMultiplicationByte = log_surgeon::finite_automata::RegexASTMultiplication<
36-
log_surgeon::finite_automata::ByteNfaState>;
36+
using RegexASTMultiplicationByte = log_surgeon::finite_automata::
37+
RegexASTMultiplication<log_surgeon::finite_automata::ByteNfaState>;
3738
using RegexASTOrByte
3839
= log_surgeon::finite_automata::RegexASTOr<log_surgeon::finite_automata::ByteNfaState>;
3940
using RegexASTCatByte

src/log_surgeon/finite_automata/Dfa.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#include <utility>
1717
#include <vector>
1818

19+
#include <fmt/format.h>
20+
#include <fmt/ranges.h>
21+
1922
#include <log_surgeon/Constants.hpp>
2023
#include <log_surgeon/finite_automata/DeterminizationConfiguration.hpp>
2124
#include <log_surgeon/finite_automata/DfaStatePair.hpp>
@@ -25,9 +28,6 @@
2528
#include <log_surgeon/finite_automata/TagOperation.hpp>
2629
#include <log_surgeon/Token.hpp>
2730

28-
#include <fmt/format.h>
29-
#include <fmt/ranges.h>
30-
3131
namespace log_surgeon::finite_automata {
3232
/**
3333
* Represents a Deterministic Finite Automaton (DFA).

src/log_surgeon/finite_automata/DfaState.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
#include <unordered_map>
1313
#include <vector>
1414

15+
#include <fmt/format.h>
16+
#include <fmt/ranges.h>
17+
1518
#include <log_surgeon/Constants.hpp>
1619
#include <log_surgeon/finite_automata/DfaTransition.hpp>
1720
#include <log_surgeon/finite_automata/RegisterOperation.hpp>
1821
#include <log_surgeon/finite_automata/StateType.hpp>
1922
#include <log_surgeon/finite_automata/UnicodeIntervalTree.hpp>
2023

21-
#include <fmt/format.h>
22-
#include <fmt/ranges.h>
23-
2424
namespace log_surgeon::finite_automata {
2525
template <StateType state_type>
2626
class DfaState;

src/log_surgeon/finite_automata/DfaTransition.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
#include <utility>
99
#include <vector>
1010

11-
#include <log_surgeon/finite_automata/RegisterOperation.hpp>
12-
#include <log_surgeon/finite_automata/StateType.hpp>
13-
1411
#include <fmt/format.h>
1512
#include <fmt/ranges.h>
1613

14+
#include <log_surgeon/finite_automata/RegisterOperation.hpp>
15+
#include <log_surgeon/finite_automata/StateType.hpp>
16+
1717
namespace log_surgeon::finite_automata {
1818
template <StateType state_type>
1919
class DfaState;

src/log_surgeon/finite_automata/Nfa.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#include <utility>
1313
#include <vector>
1414

15+
#include <fmt/format.h>
16+
#include <fmt/ranges.h>
17+
1518
#include <log_surgeon/Constants.hpp>
1619
#include <log_surgeon/finite_automata/Capture.hpp>
1720
#include <log_surgeon/finite_automata/TagOperation.hpp>
@@ -20,9 +23,6 @@
2023
#include <log_surgeon/types.hpp>
2124
#include <log_surgeon/UniqueIdGenerator.hpp>
2225

23-
#include <fmt/format.h>
24-
#include <fmt/ranges.h>
25-
2626
namespace log_surgeon::finite_automata {
2727
/**
2828
* Represents a Non-Deterministic Finite Automaton (NFA) designed to recognize a language based on

src/log_surgeon/finite_automata/NfaSpontaneousTransition.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#include <utility>
1010
#include <vector>
1111

12-
#include <log_surgeon/finite_automata/TagOperation.hpp>
13-
1412
#include <fmt/format.h>
1513
#include <fmt/ranges.h>
1614

15+
#include <log_surgeon/finite_automata/TagOperation.hpp>
16+
1717
namespace log_surgeon::finite_automata {
1818
/**
1919
* Represents an NFA transition with a collection of tag operations to be performed during the

src/log_surgeon/finite_automata/NfaState.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
#include <utility>
1414
#include <vector>
1515

16+
#include <fmt/format.h>
17+
#include <fmt/ranges.h>
18+
1619
#include <log_surgeon/Constants.hpp>
1720
#include <log_surgeon/finite_automata/NfaSpontaneousTransition.hpp>
1821
#include <log_surgeon/finite_automata/StateType.hpp>
1922
#include <log_surgeon/finite_automata/TagOperation.hpp>
2023
#include <log_surgeon/finite_automata/UnicodeIntervalTree.hpp>
2124
#include <log_surgeon/types.hpp>
2225

23-
#include <fmt/format.h>
24-
#include <fmt/ranges.h>
25-
2626
namespace log_surgeon::finite_automata {
2727
template <StateType state_type>
2828
class NfaState;

0 commit comments

Comments
 (0)