Skip to content

Commit 707d5ff

Browse files
calcmogulspacey-sooty
authored andcommitted
Upgrade to wpiformat 2025.48 (PhotonVision#2186)
1 parent 14d059e commit 707d5ff

31 files changed

Lines changed: 114 additions & 135 deletions

File tree

.clang-format

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,26 @@ ForEachMacros:
6868
- BOOST_FOREACH
6969
IncludeBlocks: Regroup
7070
IncludeCategories:
71-
- Regex: '^<ext/.*\.h>'
72-
Priority: 2
73-
SortPriority: 0
74-
- Regex: '^<.*\.h>'
75-
Priority: 1
76-
SortPriority: 0
77-
- Regex: '^<.*'
78-
Priority: 2
79-
SortPriority: 0
80-
- Regex: '.*'
81-
Priority: 3
82-
SortPriority: 0
83-
IncludeIsMainRegex: '([-_](test|unittest))?$'
71+
# C standard library headers
72+
#
73+
# https://en.cppreference.com/w/cpp/header:
74+
# * C compatibility headers
75+
# * Special C compatibility headers
76+
# * Empty C headers
77+
# * Meaningless C headers
78+
# * Unsupported C headers
79+
- Regex: '^<(assert\.h|ctype\.h|errno\.h|fenv\.h|float\.h|inttypes\.h|limits\.h|locale\.h|math\.h|setjmp\.h|signal\.h|stdarg\.h|stddef\.h|stdint\.h|stdio\.h|stdlib\.h|string\.h|time\.h|uchar\.h|wchar\.h|wctype\.h|stdatomic\.h|ccomplex|complex\.h|ctgmath|tgmath\.h|ciso646|cstdalign|cstdbool|iso646\.h|stdalign\.h|stdbool\.h|stdatomic\.h|stdnoreturn\.h|threads\.h)>'
80+
Priority: 1
81+
# C++ standard library headers (lowercase and underscores with no .h suffix)
82+
- Regex: '^<[a-z_]+>'
83+
Priority: 2
84+
# Other library headers (angle brackets)
85+
- Regex: '^<.*'
86+
Priority: 3
87+
# Project headers (double quotes)
88+
- Regex: '^".*'
89+
Priority: 4
90+
IncludeIsMainRegex: '(Test|_test)?$'
8491
IncludeIsMainSourceRegex: ''
8592
IndentCaseLabels: true
8693
IndentGotoLabels: true
@@ -136,7 +143,7 @@ RawStringFormats:
136143
CanonicalDelimiter: ''
137144
BasedOnStyle: google
138145
ReflowComments: true
139-
SortIncludes: false
146+
SortIncludes: true
140147
SortUsingDeclarations: true
141148
SpaceAfterCStyleCast: false
142149
SpaceAfterLogicalNot: false

.github/workflows/lint-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
python-version: 3.11
3333
- name: Install wpiformat
34-
run: pip3 install wpiformat==2025.34
34+
run: pip3 install wpiformat==2025.48
3535
- name: Run
3636
run: wpiformat
3737
- name: Check output

.styleguide

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
11
cppHeaderFileInclude {
22
\.h$
3-
\.hpp$
4-
\.inc$
5-
\.inl$
63
}
74

85
cppSrcFileInclude {
96
\.cpp$
107
}
118

129
modifiableFileExclude {
13-
\.jpg$
14-
\.jpeg$
15-
\.png$
16-
\.gif$
17-
\.so$
1810
\.dll$
19-
\.webp$
11+
\.gif$
2012
\.ico$
13+
\.jpeg$
14+
\.jpg$
15+
\.mp4$
16+
\.png$
2117
\.rknn$
18+
\.so$
2219
\.tflite$
23-
\.mp4$
2420
\.ttf$
21+
\.webp$
2522
\.woff2$
2623
gradlew
2724
photon-lib/py/photonlibpy/generated/
28-
photon-targeting/src/main/native/cpp/photon/constrained_solvepnp/generate/
2925
photon-targeting/src/generated/
30-
}
31-
32-
includeProject {
33-
^photonLib/
34-
}
35-
36-
includeOtherLibs {
37-
^frc/
38-
^networktables/
39-
^units/
40-
^wpi/
26+
photon-targeting/src/main/native/cpp/photon/constrained_solvepnp/generate/
4127
}

docs/.styleguide

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
21
modifiableFileExclude {
3-
\.jpg$
4-
\.jpeg$
5-
\.png$
6-
\.gif$
7-
\.so$
8-
\.pdf$
9-
\.mp4$
102
\.dll$
11-
\.webp$
3+
\.gif$
124
\.ico$
5+
\.jpeg$
6+
\.jpg$
7+
\.mp4$
8+
\.pdf$
9+
\.png$
1310
\.rknn$
14-
\.tflite$
11+
\.so$
1512
\.svg$
13+
\.tflite$
14+
\.webp$
1615
\.woff2$
1716
gradlew
1817
}

photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424

2525
#include "photon/PhotonCamera.h"
2626

27-
#include <hal/FRCUsageReporting.h>
28-
#include <net/TimeSyncServer.h>
29-
3027
#include <stdexcept>
3128
#include <string>
3229
#include <string_view>
@@ -36,6 +33,8 @@
3633
#include <frc/Errors.h>
3734
#include <frc/RobotController.h>
3835
#include <frc/Timer.h>
36+
#include <hal/FRCUsageReporting.h>
37+
#include <net/TimeSyncServer.h>
3938
#include <opencv2/core.hpp>
4039
#include <opencv2/core/mat.hpp>
4140
#include <wpi/json.h>

photon-lib/src/main/native/cpp/photon/PhotonPoseEstimator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
#include "photon/PhotonPoseEstimator.h"
2626

27-
#include <hal/FRCUsageReporting.h>
28-
2927
#include <cmath>
3028
#include <iostream>
3129
#include <limits>
@@ -41,6 +39,7 @@
4139
#include <frc/geometry/Pose3d.h>
4240
#include <frc/geometry/Rotation3d.h>
4341
#include <frc/geometry/Transform3d.h>
42+
#include <hal/FRCUsageReporting.h>
4443
#include <opencv2/calib3d.hpp>
4544
#include <opencv2/core/mat.hpp>
4645
#include <opencv2/core/types.hpp>

photon-lib/src/main/native/include/photon/simulation/PhotonCameraSim.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,24 @@
2424

2525
#pragma once
2626

27-
#include <cameraserver/CameraServer.h>
28-
#include <photon/PhotonCamera.h>
29-
#include <photon/PhotonTargetSortMode.h>
30-
#include <photon/estimation/CameraTargetRelation.h>
31-
#include <photon/estimation/VisionEstimation.h>
32-
#include <photon/networktables/NTTopicSet.h>
33-
#include <photon/simulation/SimCameraProperties.h>
34-
#include <photon/simulation/VideoSimUtil.h>
35-
#include <photon/simulation/VisionTargetSim.h>
36-
3727
#include <algorithm>
3828
#include <limits>
3929
#include <string>
4030
#include <utility>
4131
#include <vector>
4232

33+
#include <cameraserver/CameraServer.h>
4334
#include <frc/Timer.h>
4435
#include <frc/apriltag/AprilTagFieldLayout.h>
4536
#include <frc/apriltag/AprilTagFields.h>
37+
#include <photon/PhotonCamera.h>
38+
#include <photon/PhotonTargetSortMode.h>
39+
#include <photon/estimation/CameraTargetRelation.h>
40+
#include <photon/estimation/VisionEstimation.h>
41+
#include <photon/networktables/NTTopicSet.h>
42+
#include <photon/simulation/SimCameraProperties.h>
43+
#include <photon/simulation/VideoSimUtil.h>
44+
#include <photon/simulation/VisionTargetSim.h>
4645
#include <units/math.h>
4746
#include <wpi/timestamp.h>
4847

photon-lib/src/main/native/include/photon/simulation/SimCameraProperties.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
#pragma once
2626

27-
#include <photon/estimation/OpenCVHelp.h>
28-
2927
#include <algorithm>
3028
#include <random>
3129
#include <string>
@@ -37,6 +35,7 @@
3735
#include <frc/MathUtil.h>
3836
#include <frc/geometry/Rotation2d.h>
3937
#include <frc/geometry/Translation3d.h>
38+
#include <photon/estimation/OpenCVHelp.h>
4039
#include <units/frequency.h>
4140
#include <units/time.h>
4241

photon-lib/src/main/native/include/photon/simulation/VideoSimUtil.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@
2424

2525
#pragma once
2626

27-
#include <cscore_cv.h>
28-
2927
#include <algorithm>
3028
#include <numeric>
3129
#include <string>
3230
#include <unordered_map>
3331
#include <utility>
3432
#include <vector>
3533

34+
#include <cscore_cv.h>
3635
#include <frc/apriltag/AprilTag.h>
3736
#include <opencv2/core.hpp>
3837
#include <opencv2/imgcodecs.hpp>

photon-lib/src/test/native/cpp/PhotonCameraTest.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@
2222
* SOFTWARE.
2323
*/
2424

25+
#include <string>
26+
#include <vector>
27+
2528
#include <fmt/ranges.h>
29+
#include <frc/smartdashboard/SmartDashboard.h>
2630
#include <gtest/gtest.h>
2731
#include <hal/HAL.h>
2832
#include <net/TimeSyncClient.h>
2933
#include <net/TimeSyncServer.h>
34+
#include <networktables/NetworkTableInstance.h>
3035
#include <photon/PhotonCamera.h>
3136
#include <photon/simulation/PhotonCameraSim.h>
3237

33-
#include <string>
34-
#include <vector>
35-
36-
#include <frc/smartdashboard/SmartDashboard.h>
37-
#include <networktables/NetworkTableInstance.h>
38-
3938
TEST(TimeSyncProtocolTest, Smoketest) {
4039
using namespace wpi::tsp;
4140
using namespace std::chrono_literals;

0 commit comments

Comments
 (0)