Skip to content

Commit

Permalink
Making fix format more pedantic to be merciful to maintainers (envoyp…
Browse files Browse the repository at this point in the history
…roxy#2162)

Signed-off-by: Alyssa Wilk <[email protected]>
  • Loading branch information
alyssawilk authored and mattklein123 committed Dec 6, 2017
1 parent 0196c61 commit 9df61d2
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 81 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ maximize the chances of your PR being merged.

The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to
pass it on as an open-source patch. The rules are pretty simple: if you
pass it on as an open-source patch. The rules are pretty simple: if you
can certify the below (from
[developercertificate.org](http://developercertificate.org/)):

Expand Down
2 changes: 1 addition & 1 deletion DEPRECATED.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following features have been DEPRECATED and will be removed in the specified
* Config option `http_codec_options` has been deprecated and has been replaced with `http2_settings`.
* The following log macros have been deprecated: `log_trace`, `log_debug`, `conn_log`,
`conn_log_info`, `conn_log_debug`, `conn_log_trace`, `stream_log`, `stream_log_info`,
`stream_log_debug`, `stream_log_trace`. For replacements, please see
`stream_log_debug`, `stream_log_trace`. For replacements, please see
[logger.h](https://github.com/envoyproxy/envoy/blob/master/source/common/common/logger.h).
* The connectionId() and ssl() callbacks of StreamFilterCallbacks have been deprecated and
replaced with a more general connection() callback, which, when not returning a nullptr, can be
Expand Down
12 changes: 6 additions & 6 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

*Description*:
>Describe the issue. Please be detailed. If a feature request, please
describe the desired behaviour, what scenario it enables and how it
describe the desired behaviour, what scenario it enables and how it
would be used.

[optional *Relevant Links*:]
Expand All @@ -22,17 +22,17 @@ the bug, for example: Envoy should not crash, the expected value isn't
returned, etc.

*Repro steps*:
> Include sample requests, environment, etc. All data and inputs
> Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

>**Note**: The [Envoy_collect tool](https://github.com/envoyproxy/envoy/blob/master/tools/envoy_collect/README.md)
gathers a tarball with debug logs, config and the following admin
gathers a tarball with debug logs, config and the following admin
endpoints: /stats, /clusters and /server_info. Please note if there are
privacy concerns, sanitize the data prior to sharing the tarball/pasting.
privacy concerns, sanitize the data prior to sharing the tarball/pasting.

*Admin and Stats Output*:
>Include the admin output for the following endpoints: /stats,
/clusters, /routes, /server_info. For more information, refer to the
>Include the admin output for the following endpoints: /stats,
/clusters, /routes, /server_info. For more information, refer to the
[admin endpoint documentation.](https://www.envoyproxy.io/docs/envoy/latest/operations/admin)

>**Note**: If there are privacy concerns, sanitize the data prior to
Expand Down
8 changes: 4 additions & 4 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
* `typedef std::shared_ptr<Bar> BarSharedPtr;`
* `typedef std::shared_ptr<const Blah> BlahConstSharedPtr;`
* Regular pointers (e.g. `int* foo`) should not be type aliased.
* If move semantics are intended, prefer specifying function arguments with `&&`.
* If move semantics are intended, prefer specifying function arguments with `&&`.
E.g., `void onHeaders(Http::HeaderMapPtr&& headers, ...)`. The rationale for this is that it
forces the caller to specify `std::move(...)` or pass a temporary and makes the intention at
the callsite clear. Otherwise, it's difficult to tell if a const reference is actually being
passed to the called function. This is true even for `std::unique_ptr`.
* Prefer `unique_ptr` over `shared_ptr` wherever possible. `unique_ptr` makes ownership in
production code easier to reason about. Note that this creates some test oddities where
production code easier to reason about. Note that this creates some test oddities where
production code requires a `unique_ptr` but the test must still have access to the memory
the production code is using (mock or otherwise). In these cases it is acceptable to allocate
raw memory in a test and return it to the production code with the expectation that the
raw memory in a test and return it to the production code with the expectation that the
production code will hold it in a `unique_ptr` and free it. Envoy uses the factory pattern
quite a bit for these cases. (Search the code for "factory").
* The Google C++ style guide points out that [non-PoD static and global variables are forbidden](https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables).
Expand All @@ -55,7 +55,7 @@
* If a method that must be defined outside the `test` directory is intended to be called only
from test code then it should have a name that ends in `ForTest()` such as `aMethodForTest()`.
In most cases tests can and should be structured so this is not necessary.
* Tests default to StrictMock so will fail if hitting unexpected warnings. Feel free to use
* Tests default to StrictMock so will fail if hitting unexpected warnings. Feel free to use
NiceMock for mocks whose behavior is not the focus of a test.
* There are probably a few other things missing from this list. We will add them as they
are brought to our attention.
Expand Down
16 changes: 8 additions & 8 deletions bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ testing purposes. The specific versions of the Envoy dependencies used in this b
up-to-date with the latest security patches.

1. Install the latest version of [Bazel](https://bazel.build/versions/master/docs/install.html) in your environment.
2. Install external dependencies libtool, cmake, and realpath libraries separately.
2. Install external dependencies libtool, cmake, and realpath libraries separately.
On Ubuntu, run the following commands:
```
apt-get install libtool
Expand All @@ -52,7 +52,7 @@ brew install automake
Envoy compiles and passes tests with the version of clang installed by XCode 8.3.3:
Apple LLVM version 8.1.0 (clang-802.0.42).

3. Install Golang on your machine. This is required as part of building [BoringSSL](https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md)
3. Install Golang on your machine. This is required as part of building [BoringSSL](https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md)
and also for [Buildifer](https://github.com/bazelbuild/buildtools) which is used for formatting bazel BUILD files.
4. `bazel fetch //source/...` to fetch and build all external dependencies. This may take some time.
5. `bazel build //source/exe:envoy-static` from the Envoy source directory.
Expand Down Expand Up @@ -155,9 +155,9 @@ bazel test //test/common/http:async_client_impl_test --strategy=TestRunner=stand
# Stack trace symbol resolution

Envoy can produce backtraces on demand and from assertions and other fatal
actions like segfaults. The stack traces written in the log or to stderr contain
addresses rather than resolved symbols. The `tools/stack_decode.py` script exists
to process the output and do symbol resolution to make the stack traces useful. Any
actions like segfaults. The stack traces written in the log or to stderr contain
addresses rather than resolved symbols. The `tools/stack_decode.py` script exists
to process the output and do symbol resolution to make the stack traces useful. Any
log lines not relevant to the backtrace capability are passed through the script unchanged
(it acts like a filter).

Expand All @@ -178,9 +178,9 @@ You will need to use either a `dbg` build type or the `opt` build type to get sy
information in the binaries.

By default main.cc will install signal handlers to print backtraces at the
location where a fatal signal occurred. The signal handler will re-raise the
location where a fatal signal occurred. The signal handler will re-raise the
fatal signal with the default handler so a core file will still be dumped after
the stack trace is logged. To inhibit this behavior use
the stack trace is logged. To inhibit this behavior use
`--define=signal_trace=disabled` on the Bazel command line. No signal handlers will
be installed.

Expand Down Expand Up @@ -254,7 +254,7 @@ The default maximum number of stats in shared memory, and the default
maximum length of a cluster/route config/listener name, can be
overriden at compile-time by defining `ENVOY_DEFAULT_MAX_STATS` and
`ENVOY_DEFAULT_MAX_OBJ_NAME_LENGTH`, respectively, to the desired
value. For example:
value. For example:

```
bazel build --copts=-DENVOY_DEFAULT_MAX_STATS=32768 --copts=-DENVOY_DEFAULT_MAX_OBJ_NAME_LENGTH=150 //source/exe:envoy-static
Expand Down
6 changes: 3 additions & 3 deletions configs/original-dst-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An original destination cluster forwards requests to the same destination
the request was going to before being redirected to Envoy using an
iptables REDIRECT rule. `proxy_config.json` contains an example Envoy
iptables REDIRECT rule. `proxy_config.json` contains an example Envoy
configuration demonstrating the use of an original destination
cluster. `netns_setup.sh` and `netns_cleanup.sh` are provided as
examples for setting up and cleaning up, respectively, a network
Expand All @@ -21,7 +21,7 @@ the traffic matches `173.194.222.0/24` :

```
sudo ./configs/original-dst-cluster/netns_setup.sh ns1 173.194.222.0/24
```
```

# Building and running Envoy

Expand Down Expand Up @@ -71,6 +71,6 @@ the setup before:

```
sudo ./configs/original-dst-cluster/netns_cleanup.sh ns1 173.194.222.0/24
```
```

Finally, stop Envoy with `^C`.
Loading

0 comments on commit 9df61d2

Please sign in to comment.