Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add codespell to CI #2218

Merged
merged 14 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,15 @@ jobs:
- name: Check
run: >
docs/parse_cmake_options.py CMakeLists.txt --write docs/getting_started.md --verify
spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install codespell
run: >
pip install codespell==2.2.5
- name: Check
run: >
CI/check_spelling

19 changes: 19 additions & 0 deletions CI/check_spelling
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

codespell -S "*.ipynb,*.onnx,_build,*.svg" -I ./CI/codespell_ignore.txt ./Core ./Examples ./Tests ./Plugins ./docs

RETVAL=$?

if [[ $RETVAL -ne 0 ]]; then
echo ""
echo "codespell detected incorrect spelling. You have to options how to deal with this:"
benjaminhuth marked this conversation as resolved.
Show resolved Hide resolved
echo ""
echo "1) Apply one suggestion of codespell"
echo "2) If this is a false-positive, add the word to './CI/codespell_ignore.txt'"
echo " (Note that you need to add the word in lower case)"
echo ""
echo "You can apply suggestions interactively with"
echo "\`codespell -wi3 -I ./CI/codespell_ignore.txt <directory>\`"
fi

exit $RETVAL
20 changes: 20 additions & 0 deletions CI/codespell_ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
bu
strack
compres
coner
dthe
iself
sortings
fime
gaus
te
parm
writet
localy
lastr
digitial
exprot
pring
aline
boxs
ans
benjaminhuth marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class GreedyAmbiguityResolution {
/// Maximum number of iterations
std::uint32_t maximumIterations = 1000;

/// Minumum number of measurement to form a track.
/// Minimum number of measurement to form a track.
size_t nMeasurementsMin = 7;
};

Expand Down Expand Up @@ -75,7 +75,7 @@ class GreedyAmbiguityResolution {
///
/// @param tracks The input track container.
/// @param state An empty state object which is expected to be default constructed.
/// @param sourceLinkHash A functor to aquire a hash from a given source link.
/// @param sourceLinkHash A functor to acquire a hash from a given source link.
/// @param sourceLinkEquality A functor to check equality of two source links.
template <typename track_container_t, typename traj_t,
template <typename> class holder_t, typename source_link_hash_t,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void GreedyAmbiguityResolution::computeInitialState(
// count and chi2 and fill the measurement map in order to relate tracks to
// each other if they have shared hits.
for (const auto& track : tracks) {
// Kick out tracks that do not fullfil our initial requirements
// Kick out tracks that do not fulfill our initial requirements
if (track.nMeasurements() < m_cfg.nMeasurementsMin) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Clusterization/Clusterization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ template <typename CellCollection, typename ClusterCollection, size_t GridDim>
ClusterCollection mergeClusters(CellCollection& /*cells*/);

/// @brief createClusters
/// Conveniance function which runs both labelClusters and createClusters.
/// Convenience function which runs both labelClusters and createClusters.
template <typename CellCollection, typename ClusterCollection,
size_t GridDim = 2,
typename Connect =
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Definitions/Direction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Direction final {
///
/// @param scalar is the signed value
///
/// @return a direciton enum
/// @return a direction enum
static inline constexpr Direction fromScalar(ActsScalar scalar) {
assert(scalar != 0);
return scalar >= 0 ? Value::Positive : Value::Negative;
Expand All @@ -49,7 +49,7 @@ class Direction final {
///
/// @param scalar is the signed value
///
/// @return a direciton enum
/// @return a direction enum
static inline constexpr Direction fromScalarZeroAsPositive(
ActsScalar scalar) {
return scalar >= 0 ? Value::Positive : Value::Negative;
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Definitions/Tolerance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static constexpr ActsScalar s_epsilon =
/// Tolerance for being on Surface
///
/// @note This is intentionally given w/o an explicit unit to avoid having
/// to include the units header unneccessarily. With the native length
/// to include the units header unnecessarily. With the native length
/// unit of mm this corresponds to 0.1um.
static constexpr ActsScalar s_onSurfaceTolerance = 1e-4;

Expand Down
12 changes: 6 additions & 6 deletions Core/include/Acts/Definitions/TrackParametrization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ enum BoundIndices : unsigned int {
/// in `namespace Acts` and are prefixed to avoid naming collisions.
enum FreeIndices : unsigned int {
// Spatial position
// The spatial position components must be stored as one continous block.
// The spatial position components must be stored as one continuous block.
eFreePos0 = 0u,
eFreePos1 = eFreePos0 + 1u,
eFreePos2 = eFreePos0 + 2u,
// Time
eFreeTime = 3u,
// (Unit) direction
// The direction components must be stored as one continous block.
// The direction components must be stored as one continuous block.
eFreeDir0 = 4u,
eFreeDir1 = eFreeDir0 + 1u,
eFreeDir2 = eFreeDir0 + 2u,
Expand Down Expand Up @@ -108,10 +108,10 @@ static_assert(FreeIndices::eFreeSize == 8u,
static_assert(eBoundLoc0 != eBoundLoc1, "Local parameters must be different");

// Ensure free track parameter indices are consistently defined.
static_assert(eFreePos1 == eFreePos0 + 1u, "Position must be continous");
static_assert(eFreePos2 == eFreePos0 + 2u, "Position must be continous");
static_assert(eFreeDir1 == eFreeDir0 + 1u, "Direction must be continous");
static_assert(eFreeDir2 == eFreeDir0 + 2u, "Direction must be continous");
static_assert(eFreePos1 == eFreePos0 + 1u, "Position must be continuous");
static_assert(eFreePos2 == eFreePos0 + 2u, "Position must be continuous");
static_assert(eFreeDir1 == eFreeDir0 + 1u, "Direction must be continuous");
static_assert(eFreeDir2 == eFreeDir0 + 2u, "Direction must be continuous");

// Shorthand vector/matrix types related to bound track parameters.
using BoundVector = ActsVector<eBoundSize>;
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Definitions/Units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace Acts {
/// double bfield = 3.9_T;
///
/// // convert output values (via unit constants)
/// doube t_in_ns = trackPars.time() / Acts::UnitConstants::ns;
/// double t_in_ns = trackPars.time() / Acts::UnitConstants::ns;
/// // convert output values (via unit user literals)
/// double x_in_mm = trackPars.position()[ePos0] / 1_mm;
/// double p_in_TeV = trackPars.absoluteMomentum() / 1_TeV;
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Detector/CylindricalContainerBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class CylindricalContainerBuilder : public IDetectorComponentBuilder {
std::vector<std::shared_ptr<const IDetectorComponentBuilder>> builders = {};
/// Binning prescription of attachment
std::vector<BinningValue> binning = {};
/// Auxilliary information, mainly for screen output
std::string auxilliary = "";
/// Auxiliary information, mainly for screen output
std::string auxiliary = "";
};

/// Constructor with configuration arguments
Expand All @@ -65,7 +65,7 @@ class CylindricalContainerBuilder : public IDetectorComponentBuilder {
/// configuration object
Config m_cfg;

/// Private acces method to the logger
/// Private access method to the logger
const Logger& logger() const { return *m_logger; }

/// logging instance
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Detector/Detector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Detector : public std::enable_shared_from_this<Detector> {
///
/// @param name the detecor name
/// @param rootVolumes the volumes contained by this detector
/// @param detectorVolumeUpdator is a Delegate to find the assocaited volume
/// @param detectorVolumeUpdator is a Delegate to find the associated volume
///
/// @note will throw an exception if volumes vector is empty
/// @note will throw an exception if duplicate volume names exist
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Detector/DetectorBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class DetectorBuilder final : public IDetectorBuilder {
std::string name = "unnamed";
/// An external builder
std::shared_ptr<const IDetectorComponentBuilder> builder = nullptr;
/// Auxilliary information
std::string auxilliary = "";
/// Auxiliary information
std::string auxiliary = "";
};

/// Constructor with configuration arguments
Expand All @@ -58,7 +58,7 @@ class DetectorBuilder final : public IDetectorBuilder {
/// configuration object
Config m_cfg;

/// Private acces method to the logger
/// Private access method to the logger
const Logger& logger() const { return *m_logger; }

/// logging instance
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Detector/DetectorComponents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct RootDetectorVolumes {
struct DetectorComponent {
/// Define a portal container
using PortalContainer = std::map<unsigned int, std::shared_ptr<Portal>>;
/// The vector of construced volume(s)
/// The vector of constructed volume(s)
std::vector<std::shared_ptr<DetectorVolume>> volumes = {};
/// The current map of outside portals
PortalContainer portals = {};
Expand Down
14 changes: 7 additions & 7 deletions Core/include/Acts/Detector/DetectorVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Detector;
///
/// @note The construction of DetectorVolumes is done via a dedicated
/// factory, this is necessary as then the shared_ptr is non-weak and it
/// can be registred in the portal generator for further geometry processing.
/// can be registered in the portal generator for further geometry processing.
///
/// @note Navigation is always done by plain pointers, while
/// object ownership is done by shared/unique pointers.
Expand Down Expand Up @@ -98,8 +98,8 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
/// @param transform the transform defining the volume position
/// @param bounds the volume bounds
/// @param surfaces are the contained surfaces of this volume
/// @param volumes are the containes volumes of this volume
/// @param detectorVolumeUpdator is a Delegate to find the assocaited volume
/// @param volumes are the contains volumes of this volume
/// @param detectorVolumeUpdator is a Delegate to find the associated volume
/// @param surfaceCandidateUpdator the navigation state updator for surfaces/portals
///
/// @note throws exception if misconfigured: no bounds
Expand Down Expand Up @@ -173,7 +173,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {

/// Const access to the transform
///
/// @param gctx the geometry contect
/// @param gctx the geometry context
///
/// @note the geometry context is currently ignored, but
/// is a placeholder for eventually misaligned volumes
Expand All @@ -184,7 +184,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {

/// Const access to the center
///
/// @param gctx the geometry contect
/// @param gctx the geometry context
///
/// @note the geometry context is currently ignored, but
/// is a placeholder for eventually misaligned volumes
Expand Down Expand Up @@ -218,7 +218,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
/// The Extent for this volume
///
/// @param gctx is the geometry context
/// @param nseg is the number of segements to approximate
/// @param nseg is the number of segments to approximate
///
/// @return an Extent object
Extent extent(const GeometryContext& gctx, size_t nseg = 1) const;
Expand Down Expand Up @@ -352,7 +352,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
// Check containment - only in debug mode
///
/// @param gctx the current geometry context object, e.g. alignment
/// @param nseg is the number of segements to approximate
/// @param nseg is the number of segments to approximate
///
/// @return a boolean indicating if the objects are properly contained
bool checkContainment(const GeometryContext& gctx, size_t nseg = 1) const;
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Detector/DetectorVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class DetectorVolumeBuilder : public IDetectorComponentBuilder {
std::shared_ptr<const IInternalStructureBuilder> internalsBuilder = nullptr;
/// Add eventual internal volume to root
bool addInternalsToRoot = false;
/// Auxilliary information
std::string auxilliary = "";
/// Auxiliary information
std::string auxiliary = "";
};

/// Constructor with configuration arguments
Expand All @@ -68,7 +68,7 @@ class DetectorVolumeBuilder : public IDetectorComponentBuilder {
/// configuration object
Config m_cfg;

/// Private acces method to the logger
/// Private access method to the logger
const Logger& logger() const { return *m_logger; }

/// logging instance
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Detector/KdtSurfacesProvider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class KdtSurfaces {
/// Cast values that turn a global position to lookup position
std::array<BinningValue, kDIM> m_casts = {};

/// Helper to generate refernce points for filling
/// Helper to generate reference points for filling
reference_generator m_rGenerator;

/// Unroll the cast loop
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Detector/LayerStructureBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class LayerStructureBuilder : public IInternalStructureBuilder {
std::vector<std::shared_ptr<Surface>> m_surfaces = {};
};

/// @brief Support parameter defintions
/// @brief Support parameter definitions
struct Support {
/// Define whether you want to build support structures
std::array<ActsScalar, 5u> values = {};
Expand Down Expand Up @@ -102,7 +102,7 @@ class LayerStructureBuilder : public IInternalStructureBuilder {
/// Polyhedron approximations
unsigned int nSegments = 1u;
/// Extra information, mainly for screen output
std::string auxilliary = "";
std::string auxiliary = "";
};

/// Constructor
Expand All @@ -124,7 +124,7 @@ class LayerStructureBuilder : public IInternalStructureBuilder {
/// configuration object
Config m_cfg;

/// Private acces method to the logger
/// Private access method to the logger
const Logger& logger() const { return *m_logger; }

/// logging instance
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Detector/PortalGenerators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Experimental {
class DetectorVolume;
class Portal;

/// The Portal genertor definition
/// The Portal generator definition
using PortalGenerator = Delegate<std::vector<std::shared_ptr<Portal>>(
const Transform3&, const VolumeBounds&,
const std::shared_ptr<DetectorVolume>&)>;
Expand All @@ -47,7 +47,7 @@ PortalGenerator defaultPortalGenerator();
/// @brief Calls the portal generation and adds registration to sub portals
///
/// This code is split off the PortalGenerator code in order to allow
/// unit testing of the portal generation wihtout detector volume construction
/// unit testing of the portal generation without detector volume construction
///
/// @param dTransform a contextually resolved transform
/// @param dBounds the detecor volume bounds
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Detector/VolumeStructureBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class VolumeStructureBuilder : public IExternalStructureBuilder {
std::vector<ActsScalar> boundValues = {};
/// The optional extent to feed into the values
std::optional<Extent> extent = std::nullopt;
/// Some auxilliary information
std::string auxilliary = "";
/// Some auxiliary information
std::string auxiliary = "";
};

/// Constructor
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Detector/detail/GridAxisGenerators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace detail {
///
/// The call operator() API allows to plug axis generators into
/// dedicated code snippets and create fitting axis types on the fly
/// which then turn into conrete Grid types.
/// which then turn into concrete Grid types.
///
namespace GridAxisGenerators {

Expand Down Expand Up @@ -58,7 +58,7 @@ using EqBound = Eq<Acts::detail::AxisBoundaryType::Bound>;
using EqOpen = Eq<Acts::detail::AxisBoundaryType::Open>;
using EqClosed = Eq<Acts::detail::AxisBoundaryType::Closed>;

/// @brief Templated base generator for vairable axis as a tuple - 1D
/// @brief Templated base generator for variable axis as a tuple - 1D
///
/// @tparam aType the type of the axis (Bound, Closed, Open)
template <Acts::detail::AxisBoundaryType aType>
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Detector/detail/IndexedGridFiller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ std::set<typename grid_type::index_t> localIndices(
///
/// @param lbins the local bins
///
/// @return a string containing the local bins orderd in a set
/// @return a string containing the local bins ordered in a set
template <typename local_bin>
std::string outputIndices(const std::set<local_bin>& lbins) {
std::string rString;
Expand Down Expand Up @@ -259,7 +259,7 @@ struct IndexedGridFiller {
std::vector<typename index_grid::grid_type::point_t> gridQueries;
gridQueries.reserve(refs.size());
for (const auto& ref : refs) {
// Cast the transfrom according to the grid binning
// Cast the transform according to the grid binning
gridQueries.push_back(iGrid.castPosition(ref));
}
ACTS_DEBUG(gridQueries.size() << " reference points generated.");
Expand Down