Skip to content

Commit

Permalink
Fix typos, add CI job to help catch them (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews committed Nov 21, 2024
1 parent a5f51f7 commit 23c7c2e
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = ./tools/astyle,./src/deps,./web/themes,./util/geosop/cxxopts.hpp
ignore-words = ./tools/codespell.ignore
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,17 @@ jobs:
set -e
sudo -E apt-get update
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cppcheck
python3 -m pip install --disable-pip-version-check --user codespell
- name: 'Check Out'
uses: actions/checkout@v4

- name: 'cppcheck'
run: ./tools/cppcheck.sh

- name: codespell
run: codespell
# false-positives can be added to tools/codespell.ignore

cmake-subproject:
name: 'CMake Subproject'
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- Breaking Changes
- Zero-length linestrings (eg LINESTRING(1 1, 1 1)) are now treated as equivalent to points (POINT(1 1)) in boolean predicates
- CMake 3.15 or later is requried (GH-1143, Mike Taves)
- CMake 3.15 or later is required (GH-1143, Mike Taves)

- Fixes/Improvements:
- WKTReader: Points with all-NaN coordinates are not considered empty anymore (GH-927, Casper van der Wel)
Expand Down Expand Up @@ -933,7 +933,7 @@ See 3.7.0 notes
- Added Polygonizer and LineMerger classes.
- python wrapper examples
- General cleanup / warnings removal
- cleaner win32 / older copilers builds
- cleaner win32 / older compilers builds
- Reduced heap allocations
- debian package builder scripts
- reduction of standard C lib headers dependency
Expand Down
2 changes: 1 addition & 1 deletion include/geos/geom/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ class GEOS_DLL Geometry {
* and dissolving the linework.
* - Unioning a set of [Polygons](@ref Polygon) will always
* return a polygonal geometry (unlike Geometry::Union(const Geometry* other) const),
* which may return geometrys of lower dimension if a topology collapse
* which may return geometries of lower dimension if a topology collapse
* occurred.
*
* @return the union geometry
Expand Down
2 changes: 1 addition & 1 deletion include/geos/geom/Surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class GEOS_DLL Surface : public Geometry {
int
compareToSameClass(const Geometry* g) const override;

// Helper method allowing PolygonImpl to use GeometryFactory without cirular imports
// Helper method allowing PolygonImpl to use GeometryFactory without circular imports
static std::unique_ptr<Geometry> createEmptyRing(const GeometryFactory&);

virtual Curve* getExteriorRing() = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/geos/io/WKTWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class GEOS_DLL WKTWriter {
/**
* Generates the WKT for a N-point <code>LineString</code>.
*
* @param seq the sequence to outpout
* @param seq the sequence to output
*
* @return the WKT
*/
Expand Down
2 changes: 1 addition & 1 deletion include/geos/noding/IteratedNoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class GEOS_DLL IteratedNoder : public Noder { // implements Noder


/** \brief
* Fully nodes a list of {@link SegmentString}s, i.e. peforms noding iteratively
* Fully nodes a list of {@link SegmentString}s, i.e. performs noding iteratively
* until no intersections are found between segments.
*
* Maintains labelling of edges correctly through the noding.
Expand Down
2 changes: 1 addition & 1 deletion include/geos/operation/overlayng/OverlayUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class GEOS_DLL OverlayUtil {
* are:
*
* - INTERSECTION: result envelope is the intersection of the input envelopes
* - DIFERENCE: result envelope is the envelope of the A input geometry
* - DIFFERENCE: result envelope is the envelope of the A input geometry
*
* Otherwise, <code>null</code> is returned to indicate full extent.
*/
Expand Down
2 changes: 1 addition & 1 deletion include/geos/planargraph/DirectedEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class GEOS_DLL DirectedEdge: public GraphComponent {
* to the given parentEdges vector.
*
* @note Parents are pushed to the parentEdges vector, make sure
* it is empty if index-based corrispondence is important.
* it is empty if index-based correspondence is important.
*/
static void toEdges(std::vector<DirectedEdge*>& dirEdges,
std::vector<Edge*>& parentEdges);
Expand Down
2 changes: 1 addition & 1 deletion include/geos/vend/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5091,7 +5091,7 @@ struct wide_string_input_helper<BaseInputAdapter, 2>
}
};

// Wraps another input apdater to convert wide character types into individual bytes.
// Wraps another input adapter to convert wide character types into individual bytes.
template<typename BaseInputAdapter, typename WideCharType>
class wide_string_input_adapter
{
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/InteriorPointArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using namespace geos::geom;
namespace geos {
namespace algorithm { // geos.algorithm

// file statics
// file statistics
namespace {

double
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/MinimumBoundingCircle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace algorithm { // geos.algorithm
std::unique_ptr<Geometry>
MinimumBoundingCircle::getCircle()
{
//TODO: ensure the output circle contains the extermal points.
//TODO: ensure the output circle contains the extremal points.
//TODO: or maybe even ensure that the returned geometry contains ALL the input points?

compute();
Expand Down
2 changes: 1 addition & 1 deletion src/geom/Point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,4 @@ Point::getCoordinatesRO() const
}

} // namespace geos::geom
} // namesapce geos
} // namespace geos
2 changes: 1 addition & 1 deletion src/geomgraph/Edge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ using namespace geos::algorithm;

/**
* Updates an IM from the label for an edge.
* Handles edges from both L and A geometrys.
* Handles edges from both L and A geometries.
*/
void
Edge::updateIM(const Label& lbl, IntersectionMatrix& im)
Expand Down
2 changes: 1 addition & 1 deletion src/index/bintree/NodeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace index { // geos.index
namespace bintree { // geos.index.bintree

/**
* Returns the index of the subnode that wholely contains the given interval.
* Returns the index of the subnode that wholly contains the given interval.
* If none does, returns -1.
*/
int
Expand Down
2 changes: 1 addition & 1 deletion src/operation/buffer/BufferCurveSetBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ BufferCurveSetBuilder::addCurve(CoordinateSequence* coord,
// coord ownership transferred to SegmentString
SegmentString* e = new NodedSegmentString(coord, coord->hasZ(), coord->hasM(), newlabel);

// SegmentString doesnt own the sequence, so we need to delete in
// SegmentString doesn't own the sequence, so we need to delete in
// the destructor
newLabels.push_back(newlabel);
curveList.push_back(e);
Expand Down
2 changes: 1 addition & 1 deletion src/operation/relate/RelateComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ RelateComputer::computeIM()

/*
* Now process improper intersections
* (eg where one or other of the geometrys has a vertex at the
* (eg where one or other of the geometries has a vertex at the
* intersection point)
* We need to compute the edge graph at all nodes to determine
* the IM.
Expand Down
2 changes: 1 addition & 1 deletion src/operation/relateng/RelateNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ RelateNG::computeLineEnds(
continue;

const LineString* line = static_cast<const LineString*>(elem);
//TODO: add optimzation to skip disjoint elements once exterior point found
//TODO: add optimization to skip disjoint elements once exterior point found
const CoordinateXY& e0 = line->getCoordinatesRO()->getAt(0);
hasExteriorIntersection |= computeLineEnd(geom, isA, &e0, geomTarget, topoComputer);
if (topoComputer.isResultKnown()) {
Expand Down
2 changes: 1 addition & 1 deletion src/operation/relateng/TopologyComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ TopologyComputer::addIntersection(NodeSection* a, NodeSection* b)
// we run this first (unlike JTS) in case the subsequent test throws
// an exception and the NodeSection pointers are not correctly
// saved in the memory managed store on the NodeSections, causing
// a small memeory leak
// a small memory leak
addNodeSections(a, b);

if (! a->isSameGeometry(b)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/geom/util/GeometryFixerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ struct test_geometryfixer_data {

std::unique_ptr<Geometry> expected = wktreader_.read(wktExpected);

// std::cout << "Reslt: " << wktwriter_.write(actual.get()) << std::endl;
// std::cout << "Expct: " << wktwriter_.write(expected.get()) << std::endl;
// std::cout << "Result: " << wktwriter_.write(actual.get()) << std::endl;
// std::cout << "Expect: " << wktwriter_.write(expected.get()) << std::endl;

ensure("Result is invalid", actual->isValid());
ensure_equals_geometry(expected.get(), actual.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<case>
<desc>mA/L
A has 2 shells touching at one vertex and one non-vertex.
B passes between the shells, but is wholely contained
B passes between the shells, but is wholly contained
</desc>
<a>
MULTIPOLYGON (((100 30, 30 110, 150 110, 100 30)),
Expand Down Expand Up @@ -204,7 +204,7 @@
</case>

<case>
<desc>A/L - wholely contained
<desc>A/L - wholly contained
</desc>
<a> POLYGON ((10 10, 60 100, 110 10, 10 10))
</a>
Expand Down
17 changes: 17 additions & 0 deletions tools/codespell.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parms
Geometrys
deques
extracter
implementors
translater
thirdparty
crate
eiter
examplar
nempty
ba
te
seh
bLoc
aLo
Wel

0 comments on commit 23c7c2e

Please sign in to comment.