Skip to content

Commit

Permalink
ci: Add spell checker to ci (envoyproxy#4439)
Browse files Browse the repository at this point in the history
Correct commonly misspelled English words

Signed-off-by: zyfjeff <[email protected]>
  • Loading branch information
zyfjeff authored and mattklein123 committed Sep 27, 2018
1 parent c52c897 commit 31d0611
Show file tree
Hide file tree
Showing 92 changed files with 236 additions and 133 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ jobs:
- run: rm -rf /home/circleci/project/.git # CircleCI git caching is likely broken
- checkout
- run: ci/do_circle_ci.sh check_format
- run: ci/do_circle_ci.sh check_spelling
build_image:
docker:
- image: circleci/python:2.7
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ git rebase -i HEAD^^
git push origin -f
```

Note, that in general rewriting history in this way is a hinderance to the review process and this
Note, that in general rewriting history in this way is a hindrance to the review process and this
should only be done to correct a DCO mistake.

## Triggering CI re-run without making changes
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/api/v2/listener/listener.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ message Filter {
// 4. Transport protocol.
// 5. Application protocols (e.g. ALPN for TLS protocol).
//
// For criterias that allow ranges or wildcards, the most specific value in any
// For criteria that allow ranges or wildcards, the most specific value in any
// of the configured filter chains that matches the incoming connection is going
// to be used (e.g. for SNI ``www.example.com`` the most specific match would be
// ``www.example.com``, then ``*.example.com``, then ``*.com``, then any filter
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/config/filter/http/jwt_authn/v2alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ The next default location is in the query parameter as:

If a custom location is desired, `from_headers` or `from_params` can be used to specify custom locations to extract JWT.

## HTTP header to pass sucessfully verified JWT
## HTTP header to pass successfully verified JWT

If a JWT is valid, its payload will be passed to the backend in a new HTTP header specified in `forward_payload_header` field. Its value is base64 encoded JWT payload in JSON.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ message HttpConnectionManager {
bool unix_sockets = 1;
}

// Configures what network addresses are considered internal for stats and header sanitazion
// Configures what network addresses are considered internal for stats and header sanitation
// purposes. If unspecified, only RFC1918 IP addresses will be considered internal.
// See the documentation for :ref:`config_http_conn_man_headers_x-envoy-internal` for more
// information about internal/external addresses.
Expand Down
4 changes: 2 additions & 2 deletions api/envoy/config/rbac/v2alpha/rbac.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ message Permission {
// When any is set, it matches any action.
bool any = 3 [(validate.rules).bool.const = true];

// A header (or psuedo-header such as :path or :method) on the incoming HTTP request. Only
// A header (or pseudo-header such as :path or :method) on the incoming HTTP request. Only
// available for HTTP request.
envoy.api.v2.route.HeaderMatcher header = 4;

Expand Down Expand Up @@ -166,7 +166,7 @@ message Principal {
// A CIDR block that describes the downstream IP.
envoy.api.v2.core.CidrRange source_ip = 5;

// A header (or psuedo-header such as :path or :method) on the incoming HTTP request. Only
// A header (or pseudo-header such as :path or :method) on the incoming HTTP request. Only
// available for HTTP request.
envoy.api.v2.route.HeaderMatcher header = 6;

Expand Down
2 changes: 1 addition & 1 deletion bazel/PPROF.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ instantiation of `MainCommonBase::MainCommonBase`:
Once these changes have been made in your working directory, it might make sense to
save the diff as a patch (`git diff > file`), which can then be quickly
applied/unapplied for testing and commiting. (`git apply`, `git apply -R`)
applied/unapplied for testing and committing. (`git apply`, `git apply -R`)
Build the binary using bazel, and run the binary without any environment variables:
Expand Down
2 changes: 1 addition & 1 deletion bazel/get_workspace_status
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
echo "BUILD_SCM_REVISION ${git_rev}"
echo "STABLE_BUILD_SCM_REVISION ${git_rev}"

# Check whether there are any uncommited changes
# Check whether there are any uncommitted changes
git diff-index --quiet HEAD --
if [[ $? == 0 ]];
then
Expand Down
2 changes: 1 addition & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _python_deps():
build_file = "@envoy//bazel/external:twitter_common_finagle_thrift.BUILD",
)

# Bazel native C++ dependencies. For the depedencies that doesn't provide autoconf/automake builds.
# Bazel native C++ dependencies. For the dependencies that doesn't provide autoconf/automake builds.
def _cc_deps():
_repository_impl("grpc_httpjson_transcoding")
native.bind(
Expand Down
8 changes: 5 additions & 3 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ The `./ci/run_envoy_docker.sh './ci/do_ci.sh <TARGET>'` targets are:
* `bazel.release.server_only` &mdash; build Envoy static binary under `-c opt` with gcc.
* `bazel.coverage` &mdash; build and run tests under `-c dbg` with gcc, generating coverage information in `$ENVOY_DOCKER_BUILD_DIR/envoy/generated/coverage/coverage.html`.
* `bazel.coverity` &mdash; build Envoy static binary and run Coverity Scan static analysis.
* `bazel.tsan` &mdash; build and run tests under `-c dbg --config=clang-tsan` with clang.
* `check_format`&mdash; run `clang-format` and `buildifier` on entire source tree.
* `fix_format`&mdash; run and enforce `clang-format` and `buildifier` on entire source tree.
* `bazel.tsan` &mdash; build and run tests under `-c dbg --config=clang-tsan` with clang-6.0.
* `check_format`&mdash; run `clang-format-6.0` and `buildifier` on entire source tree.
* `fix_format`&mdash; run and enforce `clang-format-6.0` and `buildifier` on entire source tree.
* `check_spelling`&mdash; run `misspell` on entire project.
* `fix_spelling`&mdash; run and enforce `misspell` on entire project.
* `docs`&mdash; build documentation tree in `generated/docs`.

# Testing changes to the build image as a developer
Expand Down
12 changes: 11 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -e

build_setup_args=""
if [[ "$1" == "fix_format" || "$1" == "check_format" ]]; then
if [[ "$1" == "fix_format" || "$1" == "check_format" || "$1" == "check_spelling" || "$1" == "fix_spelling" ]]; then
build_setup_args="-nofetch"
fi

Expand Down Expand Up @@ -202,6 +202,16 @@ elif [[ "$1" == "check_format" ]]; then
echo "check_format..."
./tools/check_format.py check
exit 0
elif [[ "$1" == "check_spelling" ]]; then
cd "${ENVOY_SRCDIR}"
echo "check_spelling..."
./tools/check_spelling.sh check
exit 0
elif [[ "$1" == "fix_spelling" ]];then
cd "${ENVOY_SRCDIR}"
echo "fix_spell..."
./tools/check_spelling.sh fix
exit 0
elif [[ "$1" == "docs" ]]; then
echo "generating docs..."
docs/build.sh
Expand Down
4 changes: 3 additions & 1 deletion ci/do_circle_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -e

# bazel uses jgit internally and the default circle-ci .gitconfig says to
# convert https://github.com to ssh://[email protected], which jgit does not support.
mv ~/.gitconfig ~/.gitconfig_save
if [[ -e "~/.gitconfig" ]]; then
mv ~/.gitconfig ~/.gitconfig_save
fi

export ENVOY_SRCDIR="$(pwd)"

Expand Down
2 changes: 1 addition & 1 deletion ci/run_envoy_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

. ci/envoy_build_sha.sh

# We run as root and later drop permissions. This is requried to setup the USER
# We run as root and later drop permissions. This is required to setup the USER
# in useradd below, which is need for correct Python execution in the Docker
# environment.
USER=root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Sending arbitrary content
-------------------------

By default, when transcoding occurs, gRPC-JSON encodes the message output of a gRPC service method into
JSON and sets the HTTP response `Content-Type` header to `application/json`. To send abritrary content,
JSON and sets the HTTP response `Content-Type` header to `application/json`. To send arbitrary content,
a gRPC service method can use
`google.api.HttpBody <https://github.com/googleapis/googleapis/blob/master/google/api/httpbody.proto>`_
as its output message type. The implementation needs to set
Expand Down
2 changes: 1 addition & 1 deletion docs/root/configuration/secret.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ In this example, certificates are specified in the bootstrap static_resource, th
Examples two: SDS server
------------------------

This example shows how to configurate secrets fetched from remote SDS servers:
This example shows how to configure secrets fetched from remote SDS servers:

.. code-block:: yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ Various configurable timeouts apply to an HTTP connection and its constituent st
<envoy_api_field_route.RouteAction.RetryPolicy.per_try_timeout>` granularity.
* Stream-level :ref:`per-route gRPC max timeout
<envoy_api_field_route.RouteAction.max_grpc_timeout>`: this bounds the upstream timeout and allows
the timeout to be overriden via the *grpc-timeout* request header.
the timeout to be overridden via the *grpc-timeout* request header.
4 changes: 2 additions & 2 deletions docs/root/operations/admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ The fields are:
that contains "supported_quantiles" which lists the quantiles supported and an array of computed_quantiles
that has the computed quantile for each histogram.

If a histogram is not updated during an interval, the ouput will have null for all the quantiles.
If a histogram is not updated during an interval, the output will have null for all the quantiles.

Example histogram output:

Expand Down Expand Up @@ -338,7 +338,7 @@ The fields are:
`text/event-stream <https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events>`_
format, as expected by the Hystrix dashboard.

If invoked from a browser or a terminal, the response will be shown as a continous stream,
If invoked from a browser or a terminal, the response will be shown as a continuous stream,
sent in intervals defined by the :ref:`Bootstrap <envoy_api_msg_config.bootstrap.v2.Bootstrap>`
:ref:`stats_flush_interval <envoy_api_field_config.bootstrap.v2.Bootstrap.stats_flush_interval>`

Expand Down
2 changes: 1 addition & 1 deletion include/envoy/buffer/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Instance {
virtual uint64_t reserve(uint64_t length, RawSlice* iovecs, uint64_t num_iovecs) PURE;

/**
* Search for an occurence of a buffer within the larger buffer.
* Search for an occurrence of a buffer within the larger buffer.
* @param data supplies the data to search for.
* @param size supplies the length of the data to search for.
* @param start supplies the starting index to search from.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/http/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class StreamEncoderFilter : public StreamFilterBase {

/**
* Called with trailers to be encoded, implicitly ending the stream.
* @param trailers supplies the trailes to be encoded.
* @param trailers supplies the trailers to be encoded.
*/
virtual FilterTrailersStatus encodeTrailers(HeaderMap& trailers) PURE;

Expand Down
2 changes: 1 addition & 1 deletion include/envoy/network/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Connection : public Event::DeferredDeletable, public FilterManager {

/**
* @return std::string the next protocol to use as selected by network level negotiation. (E.g.,
* ALPN). If network level negotation is not supported by the connection or no protocol
* ALPN). If network level negotiation is not supported by the connection or no protocol
* has been negotiated the empty string is returned.
*/
virtual std::string nextProtocol() const PURE;
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/network/transport_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class TransportSocket {

/**
* @return std::string the protocol to use as selected by network level negotiation. (E.g., ALPN).
* If network level negotation is not supported by the connection or no protocol
* If network level negotiation is not supported by the connection or no protocol
* has been negotiated the empty string is returned.
*/
virtual std::string protocol() const PURE;
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/router/router.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class RouteSpecificFilterConfig {
typedef std::shared_ptr<const RouteSpecificFilterConfig> RouteSpecificFilterConfigConstSharedPtr;

/**
* Virtual host defintion.
* Virtual host definition.
*/
class VirtualHost {
public:
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/hot_restart.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class HotRestart {
virtual void shutdown() PURE;

/**
* Return the hot restart compatability version so that operations code can decide whether to
* Return the hot restart compatibility version so that operations code can decide whether to
* perform a full or hot restart.
*/
virtual std::string version() PURE;
Expand Down
4 changes: 2 additions & 2 deletions source/common/access_log/access_log_formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AccessLogFormatParser {
/**
* General parse command utility. Will parse token from start position. Token is expected to end
* with ')'. An optional ":max_length" may be specified after the closing ')' char. Token may
* contain multiple values separated by "seperator" string. First value will be populated in
* contain multiple values separated by "separator" string. First value will be populated in
* "main" and any additional sub values will be set in the vector "subitems". For example token
* of: "com.test.my_filter:test_object:inner_key):100" with separator of ":" will set the
* following:
Expand All @@ -46,7 +46,7 @@ class AccessLogFormatParser {
*
* @param token the token to parse
* @param start the index to start parsing from
* @param seperator seperator between values
* @param separator separator between values
* @param main the first value
* @param sub_items any additional values
* @param max_length optional max_length will be populated if specified
Expand Down
4 changes: 2 additions & 2 deletions source/common/common/perf_annotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// bazel --define=perf_annotation=enabled ...
// or, in individual .cc files:
// #define ENVOY_PERF_ANNOTATION
// In the absense of such directives, the support classes are built and tested.
// In the absence of such directives, the support classes are built and tested.
// However, the macros for instrumenting code for performance analysis will expand
// to nothing.
//
Expand Down Expand Up @@ -59,7 +59,7 @@
#define PERF_CLEAR() Envoy::PerfAnnotationContext::clear()

/**
* Controls whether performacne collection and reporting is thread safe. For now,
* Controls whether performances collection and reporting is thread safe. For now,
* leaving this enabled for predictability across multiiple applications, on the assumption
* that an uncontended mutex lock has vanishingly small cost. In the future we may try
* to make this system thread-unsafe if mutex contention disturbs the metrics.
Expand Down
2 changes: 1 addition & 1 deletion source/common/common/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class StringUtil {

/**
* Crop characters from a string view starting at the first character of the matched
* delimiter string view until the begining of the source string view.
* delimiter string view until the beginning of the source string view.
* @param source supplies the string view to be processed.
* @param delimiter supplies the string view that delimits the starting point for deletion.
* @return sub-string of the string view if any.
Expand Down
2 changes: 1 addition & 1 deletion source/common/event/dispatcher_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void DispatcherImpl::run(RunType type) {

// Flush all post callbacks before we run the event loop. We do this because there are post
// callbacks that have to get run before the initial event loop starts running. libevent does
// not gaurantee that events are run in any particular order. So even if we post() and call
// not guarantee that events are run in any particular order. So even if we post() and call
// event_base_once() before some other event, the other event might get called first.
runPostCallbacks();

Expand Down
2 changes: 1 addition & 1 deletion source/common/filesystem/filesystem_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class FileImpl : public File {
// not get interleaved by multiple processes writing to
// the same file during hot-restart.
Thread::MutexBasicLockable flush_lock_; // This lock is used to prevent simulataneous flushes from
// the flush thread and a syncronous flush. This protects
// the flush thread and a synchronous flush. This protects
// concurrent access to the about_to_write_buffer_, fd_,
// and all other data used during flushing and file
// re-opening.
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/codec_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CodecClient : Logger::Loggable<Logger::Id::client>,
uint64_t id() { return connection_->id(); }

/**
* @return size_t the number of oustanding requests that have not completed or been reset.
* @return size_t the number of outstanding requests that have not completed or been reset.
*/
size_t numActiveRequests() { return active_requests_.size(); }

Expand Down
2 changes: 1 addition & 1 deletion source/common/http/conn_manager_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class ConnectionManagerConfig {
virtual DateProvider& dateProvider() PURE;

/**
* @return the time in milliseconds the connection manager will wait betwen issuing a "shutdown
* @return the time in milliseconds the connection manager will wait between issuing a "shutdown
* notice" to the time it will issue a full GOAWAY and not accept any new streams.
*/
virtual std::chrono::milliseconds drainTimeout() PURE;
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/conn_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ void ConnectionManagerImpl::ActiveStream::decodeHeaders(HeaderMapPtr&& headers,
// The protocol may have shifted in the HTTP/1.0 case so reset it.
request_info_.protocol(protocol);
if (!connection_manager_.config_.http1Settings().accept_http_10_) {
// Send "Upgrade Required" if HTTP/1.0 support is not explictly configured on.
// Send "Upgrade Required" if HTTP/1.0 support is not explicitly configured on.
sendLocalReply(false, Code::UpgradeRequired, "", nullptr, is_head_request_);
return;
} else {
Expand Down Expand Up @@ -671,7 +671,7 @@ void ConnectionManagerImpl::ActiveStream::decodeHeaders(HeaderMapPtr&& headers,

decodeHeaders(nullptr, *request_headers_, end_stream);

// Reset it here for both global and overriden cases.
// Reset it here for both global and overridden cases.
resetIdleTimer();
}

Expand Down
2 changes: 1 addition & 1 deletion source/common/http/header_map_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class HeaderMapImpl : public HeaderMap, NonCopyable {
*
* Note: the internal iterators held in fields make this unsafe to copy and move, since the
* reference to end() is not preserved across a move (see Notes in
* https://en.cppreference.com/w/cpp/container/list/list). The NonCopyable will supress both copy
* https://en.cppreference.com/w/cpp/container/list/list). The NonCopyable will suppress both copy
* and move constructors/assignment.
* TODO(htuch): Maybe we want this to movable one day; for now, our header map moves happen on
* HeaderMapPtr, so the performance impact should not be evident.
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/http1/codec_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class ConnectionImpl : public virtual Connection, protected Logger::Loggable<Log
/**
* Dispatch a memory span.
* @param slice supplies the start address.
* @len supplies the lenght of the span.
* @len supplies the length of the span.
*/
size_t dispatchSlice(const char* slice, size_t len);

Expand Down Expand Up @@ -297,7 +297,7 @@ class ServerConnectionImpl : public ServerConnection, public ConnectionImpl {

/**
* Manipulate the request's first line, parsing the url and converting to a relative path if
* neccessary. Compute Host / :authority headers based on 7230#5.7 and 7230#6
* necessary. Compute Host / :authority headers based on 7230#5.7 and 7230#6
*
* @param is_connect true if the request has the CONNECT method
* @param headers the request's headers
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/http2/codec_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ Http::StreamEncoder& ClientConnectionImpl::newStream(StreamDecoder& decoder) {
}

int ClientConnectionImpl::onBeginHeaders(const nghttp2_frame* frame) {
// The client code explicitly does not currently suport push promise.
// The client code explicitly does not currently support push promise.
RELEASE_ASSERT(frame->hd.type == NGHTTP2_HEADERS, "");
RELEASE_ASSERT(frame->headers.cat == NGHTTP2_HCAT_RESPONSE ||
frame->headers.cat == NGHTTP2_HCAT_HEADERS,
Expand All @@ -803,7 +803,7 @@ int ClientConnectionImpl::onBeginHeaders(const nghttp2_frame* frame) {

int ClientConnectionImpl::onHeader(const nghttp2_frame* frame, HeaderString&& name,
HeaderString&& value) {
// The client code explicitly does not currently suport push promise.
// The client code explicitly does not currently support push promise.
ASSERT(frame->hd.type == NGHTTP2_HEADERS);
ASSERT(frame->headers.cat == NGHTTP2_HCAT_RESPONSE || frame->headers.cat == NGHTTP2_HCAT_HEADERS);
return saveHeader(frame, std::move(name), std::move(value));
Expand Down
Loading

0 comments on commit 31d0611

Please sign in to comment.