Skip to content

Commit

Permalink
fix: use regex in iwyu.imp (#1162)
Browse files Browse the repository at this point in the history
### Briefly, what does this PR introduce?
Instead of exhaustive lists in iwyu.imp we can use regex now. Avoids
overlooking additions like we had with the measurements datatype.

TODO:
- [x] revert
00d9f3d
- [x] revert
26bea24

### What kind of change does this PR introduce?
- [x] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No.

### Does this PR change default behavior?
No.

---------

Co-authored-by: Dmitry Kalinkin <[email protected]>
  • Loading branch information
wdconinc and veprbl authored Dec 8, 2023
1 parent d65783d commit 3ad7e59
Show file tree
Hide file tree
Showing 79 changed files with 108 additions and 398 deletions.
258 changes: 20 additions & 238 deletions .github/iwyu.imp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
while [[ ${sha:-} != $(git diff | sha256sum) ]] ; do
sha=$(git diff | sha256sum)
echo $sha
iwyu_tool.py -p build $(git diff --name-only ${{github.event.pull_request.head.sha}} ${{ github.event.pull_request.base.sha }}) -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp | tee iwyu_fixes.log
iwyu_tool.py -p build $(git diff --name-only ${{github.event.pull_request.head.sha}} ${{ github.event.pull_request.base.sha }}) -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp -Xiwyu --regex=ecmascript | tee iwyu_fixes.log
fix_includes.py --blank_lines --nosafe_headers --reorder --separate_project_includes="<tld>" --keep_iwyu_namespace_format < iwyu_fixes.log
git diff | tee iwyu_fixes.patch
done
Expand All @@ -191,7 +191,7 @@ jobs:
platform-release: "${{ env.platform-release }}"
run: |
# don't aim for stability for all files
iwyu_tool.py -p build -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp | tee iwyu_fixes.log
iwyu_tool.py -p build -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp -Xiwyu --regex=ecmascript | tee iwyu_fixes.log
fix_includes.py --blank_lines --nosafe_headers --reorder --separate_project_includes="<tld>" --keep_iwyu_namespace_format < iwyu_fixes.log
git diff | tee iwyu_fixes.patch
- name: Upload iwyu patch as artifact
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/calorimetry/CalorimeterClusterRecoCoG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include <Evaluator/DD4hepUnits.h>
#include <boost/algorithm/string/join.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/range/adaptor/map.hpp>
#include <edm4eic/CalorimeterHitCollection.h>
#include <edm4hep/CaloHitContributionCollection.h>
Expand Down
5 changes: 1 addition & 4 deletions src/algorithms/calorimetry/CalorimeterHitDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@
#include <Evaluator/DD4hepUnits.h>
#include <edm4hep/CaloHitContributionCollection.h>
#include <fmt/core.h>
#include <gsl/pointers>
#include <podio/RelationRange.h>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <exception>
#include <gsl/pointers>
#include <limits>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/calorimetry/CalorimeterHitReco.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#include <DD4hep/config.h>
#include <DDSegmentation/BitFieldCoder.h>
#include <Evaluator/DD4hepUnits.h>
#include <Math/GenVector/Cartesian3D.h>
#include <Math/GenVector/DisplacementVector3D.h>
#include <fmt/core.h>
#include <fmt/format.h>
#include <algorithm>
#include <cctype>
#include <exception>
#include <functional>
#include <map>
#include <ostream>
Expand Down
4 changes: 1 addition & 3 deletions src/algorithms/calorimetry/CalorimeterHitsMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
#include <DD4hep/VolumeManager.h>
#include <DDSegmentation/BitFieldCoder.h>
#include <Evaluator/DD4hepUnits.h>
#include <Math/GenVector/Cartesian3D.h>
#include <Math/GenVector/DisplacementVector3D.h>
#include <fmt/core.h>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <exception>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/calorimetry/CalorimeterIslandCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <array>
#include <cmath>
#include <cstddef>
#include <exception>
#include <functional>
#include <memory>
#include <set>
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/digi/SiliconTrackerDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <exception>
#include <unordered_map>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/pid/IrtCherenkovParticleID.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#include <edm4hep/Vector2f.h>
#include <fmt/core.h>
#include <fmt/format.h>
#include <podio/ObjectID.h>
#include <podio/RelationRange.h>
#include <spdlog/common.h>
#include <algorithm>
#include <cstddef>
#include <exception>
#include <functional>
#include <iterator>
#include <set>
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/pid/MergeParticleID.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

#include <edm4eic/CherenkovParticleIDHypothesis.h>
#include <edm4eic/TrackSegmentCollection.h>
#include <edm4hep/Vector2f.h>
#include <fmt/core.h>
#include <podio/ObjectID.h>
#include <podio/RelationRange.h>
#include <spdlog/common.h>
#include <stddef.h>
#include <exception>
#include <stdexcept>
#include <unordered_map>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/pid/MergeTracks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <podio/RelationRange.h>
#include <algorithm>
#include <cstddef>
#include <exception>
#include <iterator>
#include <unordered_map>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/reco/ElectronReconstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <edm4eic/ClusterCollection.h>
#include <edm4hep/utils/vector_utils.h>
#include <fmt/core.h>
#include <exception>

namespace eicrecon {

Expand Down
14 changes: 6 additions & 8 deletions src/algorithms/reco/InclusiveKinematicsDA.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Wouter Deconinck

#include <algorithm>
#include <cmath>
#include <exception>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicsDA.h"

#include <Math/GenVector/LorentzVector.h>
#include <Math/GenVector/PxPyPzE4D.h>
#include <Math/Vector4Dfwd.h>
#include <edm4eic/InclusiveKinematicsCollection.h>
#include <edm4eic/MCRecoParticleAssociationCollection.h>
Expand All @@ -18,6 +11,11 @@
#include <edm4hep/Vector3f.h>
#include <fmt/core.h>
#include <podio/ObjectID.h>
#include <cmath>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicsDA.h"

using ROOT::Math::PxPyPzEVector;

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/reco/InclusiveKinematicsElectron.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright (C) 2022, 2023 Wouter Deconinck, Tooba Ali

#include <Math/GenVector/LorentzVector.h>
#include <Math/GenVector/PxPyPzE4D.h>
#include <Math/Vector4Dfwd.h>
#include <edm4eic/InclusiveKinematicsCollection.h>
#include <edm4eic/MCRecoParticleAssociationCollection.h>
Expand All @@ -11,7 +12,6 @@
#include <fmt/core.h>
#include <podio/ObjectID.h>
#include <cmath>
#include <exception>
#include <vector>

#include "Beam.h"
Expand Down
14 changes: 6 additions & 8 deletions src/algorithms/reco/InclusiveKinematicsJB.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Wouter Deconinck

#include <algorithm>
#include <cmath>
#include <exception>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicsJB.h"

#include <Math/GenVector/LorentzVector.h>
#include <Math/GenVector/PxPyPzE4D.h>
#include <Math/Vector4Dfwd.h>
#include <edm4eic/InclusiveKinematicsCollection.h>
#include <edm4eic/MCRecoParticleAssociationCollection.h>
Expand All @@ -18,6 +11,11 @@
#include <edm4hep/Vector3f.h>
#include <fmt/core.h>
#include <podio/ObjectID.h>
#include <cmath>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicsJB.h"

using ROOT::Math::PxPyPzEVector;

Expand Down
14 changes: 6 additions & 8 deletions src/algorithms/reco/InclusiveKinematicsSigma.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Wouter Deconinck, Barak Schmookler

#include <algorithm>
#include <cmath>
#include <exception>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicsSigma.h"

#include <Math/GenVector/LorentzVector.h>
#include <Math/GenVector/PxPyPzE4D.h>
#include <Math/Vector4Dfwd.h>
#include <edm4eic/InclusiveKinematicsCollection.h>
#include <edm4eic/MCRecoParticleAssociationCollection.h>
Expand All @@ -18,6 +11,11 @@
#include <edm4hep/Vector3f.h>
#include <fmt/core.h>
#include <podio/ObjectID.h>
#include <cmath>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicsSigma.h"

using ROOT::Math::PxPyPzEVector;

Expand Down
11 changes: 5 additions & 6 deletions src/algorithms/reco/InclusiveKinematicsTruth.cc
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Wouter Deconinck

#include <cmath>
#include <exception>

#include "Beam.h"
#include "InclusiveKinematicsTruth.h"

#include <Math/GenVector/LorentzVector.h>
#include <Math/GenVector/PxPyPzE4D.h>
#include <Math/Vector4Dfwd.h>
#include <edm4eic/InclusiveKinematicsCollection.h>
#include <edm4hep/MCParticleCollection.h>
#include <edm4hep/Vector3f.h>
#include <edm4hep/utils/vector_utils.h>
#include <fmt/core.h>
#include <cmath>

#include "Beam.h"
#include "InclusiveKinematicsTruth.h"

using ROOT::Math::PxPyPzEVector;

Expand Down
14 changes: 6 additions & 8 deletions src/algorithms/reco/InclusiveKinematicseSigma.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Wouter Deconinck, Barak Schmookler

#include <algorithm>
#include <cmath>
#include <exception>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicseSigma.h"

#include <Math/GenVector/LorentzVector.h>
#include <Math/GenVector/PxPyPzE4D.h>
#include <Math/Vector4Dfwd.h>
#include <edm4eic/InclusiveKinematicsCollection.h>
#include <edm4eic/MCRecoParticleAssociationCollection.h>
Expand All @@ -18,6 +11,11 @@
#include <edm4hep/Vector3f.h>
#include <fmt/core.h>
#include <podio/ObjectID.h>
#include <cmath>

#include "Beam.h"
#include "Boost.h"
#include "InclusiveKinematicseSigma.h"

using ROOT::Math::PxPyPzEVector;

Expand Down
1 change: 0 additions & 1 deletion src/algorithms/reco/JetReconstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// for fastjet objects
#include <fastjet/PseudoJet.hh>
#include <fmt/core.h>
#include <exception>
#include <stdexcept>

#include "algorithms/reco/JetReconstructionConfig.h"
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/reco/MC2SmearedParticle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <edm4hep/Vector3d.h>
#include <edm4hep/Vector3f.h>
#include <fmt/core.h>
#include <exception>
#include <utility>


Expand Down
2 changes: 0 additions & 2 deletions src/algorithms/reco/MatchClusters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
#include <podio/ObjectID.h>
#include <spdlog/common.h>
#include <cmath>
#include <exception>
#include <map>
#include <type_traits>
#include <vector>

#include "MatchClusters.h"
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/tracking/ActsGeometryProvider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <Acts/Surfaces/PlanarBounds.hpp>
#include <Acts/Surfaces/PlaneSurface.hpp>
#include <Acts/Surfaces/Surface.hpp>
#include <Acts/Surfaces/SurfaceArray.hpp>
#include <Acts/Surfaces/SurfaceBounds.hpp>
#include <Acts/Utilities/BinningType.hpp>
#include <Acts/Utilities/Result.hpp>
Expand Down
2 changes: 2 additions & 0 deletions src/algorithms/tracking/ActsGeometryProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <DD4hep/Detector.h>
#include <DD4hep/Fields.h>
#include <Evaluator/DD4hepUnits.h>
#include <Math/GenVector/Cartesian3D.h>
#include <Math/GenVector/DisplacementVector3D.h>
#include <spdlog/logger.h>
#include <cstdint>
#include <map>
Expand Down
7 changes: 2 additions & 5 deletions src/algorithms/tracking/CKFTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <Acts/EventData/MultiTrajectoryHelpers.hpp>
#include <Acts/EventData/ParticleHypothesis.hpp>
#include <Acts/EventData/SourceLink.hpp>
#include <Acts/EventData/TrackContainer.hpp>
#include <Acts/EventData/TrackProxy.hpp>
#include <Acts/EventData/TrackStateType.hpp>
#include <Acts/EventData/VectorMultiTrajectory.hpp>
Expand All @@ -22,8 +23,6 @@
#include <Acts/Surfaces/Surface.hpp>
#include <Acts/TrackFitting/GainMatrixSmoother.hpp>
#include <Acts/TrackFitting/GainMatrixUpdater.hpp>
#include <Acts/TrackFitting/KalmanFitter.hpp>
#include <Acts/Utilities/Delegate.hpp>
#include <Acts/Utilities/Logger.hpp>
#include <ActsExamples/EventData/IndexSourceLink.hpp>
#include <ActsExamples/EventData/Measurement.hpp>
Expand All @@ -37,15 +36,13 @@
#include <edm4hep/Vector2f.h>
#include <fmt/core.h>
#include <Eigen/Core>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <exception>
#include <functional>
#include <list>
#include <optional>
#include <string>
#include <utility>
#include <variant>

#include "ActsGeometryProvider.h"
#include "DD4hepBField.h"
Expand Down
1 change: 0 additions & 1 deletion src/algorithms/tracking/CKFTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#pragma once

#include <Acts/EventData/TrackContainer.hpp>
#include <Acts/EventData/VectorMultiTrajectory.hpp>
#include <Acts/Geometry/GeometryContext.hpp>
#include <Acts/Geometry/TrackingGeometry.hpp>
Expand Down
Loading

0 comments on commit 3ad7e59

Please sign in to comment.