Skip to content
Permalink
Browse files
Add spell check to makefile to check for typos ticket#25024
- Use misspell to check for typos in codebase
- Add `make check-typos` to run the checks
- Add `check-typos` to `make check`
  • Loading branch information
fristonio authored and asn-d6 committed Mar 27, 2018
1 parent 979c7e5 commit aa6f498a07a3ef192bfe26420e49b16df47a003a
Showing with 21 additions and 1 deletion.
  1. +21 −1 Makefile.am
@@ -97,7 +97,7 @@ doxygen:
test: all
$(top_builddir)/src/test/test

check-local: check-spaces check-changes
check-local: check-spaces check-changes check-typos

This comment has been minimized.

Copy link
@nmathewson

nmathewson Apr 9, 2018

If I install 'misspell' and apply this patch, will it break Tor builds for now? If so, we shouldn't add it to check-local until it actually passes.

This comment has been minimized.

Copy link
@fristonio

fristonio Apr 14, 2018

Author

In my opinion, we should not add it to check-local. As asn said this should be made completely optional and I completely with this point.
Also, there are some files /src/tests/ breaks this check.


need-chutney-path:
@if test ! -d "$$CHUTNEY_PATH"; then \
@@ -217,6 +217,26 @@ check-logs:
$(top_srcdir)/scripts/maint/checkLogs.pl \
$(top_srcdir)/src/*/*.[ch] | sort -n

.PHONY: check-typos
check-typos:
@if test -x "`which misspell 2>&1;true`"; then \
echo "Checking for Typos ..."; \
(`which misspell` \

This comment has been minimized.

Copy link
@nmathewson

nmathewson Apr 9, 2018

"which misspell" in this context doesn't actually do anything different from just calling "misspell". Remember, "which" looks up the executable in the path ... but that's the same behavior as just using the executable's name.

$(top_srcdir)/src/**/*.[ch] \

This comment has been minimized.

Copy link
@nmathewson

nmathewson Apr 9, 2018

The "**" here doesn't do anything different from "*".

Additionally, we should exclude src/ext from spellchecking, since that isn't our code.

$(top_srcdir)/doc \
$(top_srcdir)/contrib \
$(top_srcdir)/scripts \
$(top_srcdir)/README \
$(top_srcdir)/ChangeLog \
$(top_srcdir)/INSTALL \
$(top_srcdir)/ReleaseNotes \
$(top_srcdir)/LICENSE); \
else \
echo "Tor uses misspell to check for typos"; \
echo "It seems that you don't have misspell installed."; \
echo "Install the latest version of misspell from here https://github.com/client9/misspell#install"; \
fi

.PHONY: check-changes
check-changes:
if USEPYTHON

0 comments on commit aa6f498

Please sign in to comment.