Skip to content

Commit fb63d00

Browse files
authored
Merge pull request #794 from ccoVeille/typos-suggestion
chore: fix typos and style
2 parents 0650c45 + 01aa551 commit fb63d00

8 files changed

+20
-20
lines changed

.github/ISSUE_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PLEASE READ
22
-------------
33

4-
DO NOT submit tickets without _first_ using the latest version of Golang, clearing your local golang package cache, and re-building mockery using the _latest_ Golang version and the _latest_ version of mockery. Please provide evidence this has been done in your issue. Failure to provide this evidence will likely result in your issue being closed.
4+
DO NOT submit tickets without _first_ using the latest version of Go, clearing your local golang package cache, and re-building mockery using the _latest_ Go version and the _latest_ version of mockery. Please provide evidence this has been done in your issue. Failure to provide this evidence will likely result in your issue being closed.
55

66
Description
77
-------------
@@ -13,7 +13,7 @@ Mockery Version
1313

1414
[version of mockery being used]
1515

16-
Golang Version
16+
Go Version
1717
--------------
1818

1919
[version of golang being used]

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Please include a summary of the changes and the related issue. Please also inclu
1212
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
1313
- [ ] This change requires a documentation update
1414

15-
Version of Golang used when building/testing:
15+
Version of Go used when building/testing:
1616
---------------------------------------------
1717

1818
- [ ] 1.11

docs/configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Parameter Descriptions
8181
| [`recursive`](features.md#recursive-package-discovery) | :fontawesome-solid-x: | `#!yaml false` | When set to `true` on a particular package, mockery will recursively search for all sub-packages and inject those packages into the config map. |
8282
| [`replace-type`](features.md#replace-types) | :fontawesome-solid-x: | `#!yaml null` | Replaces aliases, packages and/or types during generation. |
8383
| `tags` | :fontawesome-solid-x: | `#!yaml ""` | A space-separated list of additional build tags to load packages. |
84-
| [`with-expecter`](features.md#expecter-structs) | :fontawesome-solid-x: | `#!yaml true` | Use `with-expecter: True` to generate `EXPECT()` methods for your mocks. This is the preferred way to setup your mocks. |
84+
| [`with-expecter`](features.md#expecter-structs) | :fontawesome-solid-x: | `#!yaml true` | Use `with-expecter: True` to generate `EXPECT()` methods for your mocks. This is the preferred way to set up your mocks. |
8585

8686
Layouts
8787
-------

docs/features.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (_m *Handler) HandleMessage(m pubsub.Message) error {
9090
}
9191
```
9292

93-
Generic type constraints can also be replaced by targeting the changed parameter with the square bracket notation on the left hand side.
93+
Generic type constraints can also be replaced by targeting the changed parameter with the square bracket notation on the left-hand side.
9494

9595
```shell
9696
mockery --replace-type github.com/vektra/mockery/v2/baz/internal/foo.InternalBaz[T]=github.com/vektra/mockery/v2/baz.Baz
@@ -233,12 +233,12 @@ packages:
233233
with-expecter: true
234234
```
235235

236-
You can use the `showconfig` command to see the config mockery injects. The output of `showconfig` theoretically could be copy-pasted into your yaml file as it is semantically equivalent.
236+
You can use the `showconfig` command to see the config mockery injects. The output of `showconfig` theoretically could be copy-pasted into your YAML file as it is semantically equivalent.
237237

238238
mockery will _not_ recurse into submodules, i.e. any subdirectory that contains a go.mod file. You must specify the submodule as a separate line item in the config if you would like mocks generated for it as well.
239239

240240
??? note "performance characteristics"
241-
The performance when using `#!yaml recursive: true` may be worse than manually specifying all packages statically in the yaml file. This is because of the fact that mockery has to recursively walk the filesystem path that contains the package in question. It may unnecessarily walk down unrelated paths (for example, a Python virtual environment that is in the same path as your package). For this reason, it is recommended _not_ to use `#!yaml recursive: true` if it can be avoided.
241+
The performance when using `#!yaml recursive: true` may be worse than manually specifying all packages statically in the YAML file. This is because of the fact that mockery has to recursively walk the filesystem path that contains the package in question. It may unnecessarily walk down unrelated paths (for example, a Python virtual environment that is in the same path as your package). For this reason, it is recommended _not_ to use `#!yaml recursive: true` if it can be avoided.
242242

243243
### Regex matching
244244

@@ -334,7 +334,7 @@ Return Value Providers
334334

335335
:octicons-tag-24: v2.20.0
336336

337-
Return Value Providers can be used one of two ways. You may either define a single function with the exact same signature (number and type of input and return parameters) and pass that as a single value to `Return`, or you may pass multiple values to `Return` (one for each return parameter of the mocked function.) If you are using the second form, for each of the return values of the mocked function, `Return` needs a function which takes the same arguments as the mocked function, and returns one of the return values. For example, if the return argument signature of `passthrough` in the above example was instead `(string, error)` in the interface, `Return` would also need a second function argument to define the error value:
337+
Return Value Providers can be used one of two ways. You may either define a single function with the exact same signature (number and type of input and return parameters) and pass that as a single value to `Return`, or you may pass multiple values to `Return` (one for each return parameter of the mocked function.) If you are using the second form, for each of the return values of the mocked function, `Return` needs a function which takes the same arguments as the mocked function, and returns one of the return values. For example, if the return argument signature of `passthrough` in the above example was instead `(string, error)` in the interface, `Return` would also need a second function argument to define the error value:
338338

339339
```go
340340
type Proxy interface {

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func getFromDB(db DB) string {
2525
}
2626
```
2727

28-
You can test `getFromDB` by either instantiating a testing database, or you can simply create a mock implementation of `DB` using mockery. Mockery can autogenerate a mock implementation that allows us to define assertions on how the mock was used, what to return, and other useful tidbits. We can add a `//go:generate` directive above our interface:
28+
You can test `getFromDB` by either instantiating a testing database, or you can simply create a mock implementation of `DB` using mockery. Mockery can automatically generate a mock implementation that allows us to define assertions on how the mock was used, what to return, and other useful tidbits. We can add a `//go:generate` directive above our interface:
2929

3030
```golang title="db.go"
3131
//go:generate mockery --name DB

docs/migrating_to_packages.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Migrating To Packages
33
---
44

5-
The [packages](features.md#packages-configuration) feature is a new configuration scheme that aims to simplify and improve a lot of legacy behavior. This will be the only way to generate mocks in v3. These docs outline general principals for migrating to the new scheme.
5+
The [packages](features.md#packages-configuration) feature is a new configuration scheme that aims to simplify and improve a lot of legacy behavior. This will be the only way to generate mocks in v3. These docs outline general principles for migrating to the new scheme.
66

77
Background
88
----------
@@ -29,7 +29,7 @@ All of the parameters in the config section can be specified at the top level of
2929

3030
#### Separate `mocks/` directory
3131

32-
Take for example a configuration where you are specifying `all: true` at the top of your repo and you're placing your mocks in a separate `mocks/` directory, mirroring the directory structure of your original repo.
32+
Take for example a configuration where you are specifying `all: true` at the top of your repo, and you're placing your mocks in a separate `mocks/` directory, mirroring the directory structure of your original repo.
3333

3434
```yaml
3535
testonly: False
@@ -53,7 +53,7 @@ packages:
5353
recursive: True
5454
```
5555

56-
1. The use of `replaceAll` is a trick that is done to ensure mocks created for `internal` packages can be imported outside of the mock directory. This retains the behavior of the legacy config.
56+
1. The use of `replaceAll` is a trick that is done to ensure mocks created for `internal` packages can be imported outside the mock directory. This retains the behavior of the legacy config.
5757

5858
While the example config provided here is more verbose, that is because we're specifying many non-default values in order to retain strict equivalence for this example. It's recommended to refer to the [configuration parameters](configuration.md#parameter-descriptions) to see the defaults provided.
5959

@@ -98,7 +98,7 @@ Previously, the recommended way of generating mocks was to call `mockery` once p
9898
Behavior Changes
9999
-----------------
100100

101-
The legacy behavior iterated over every `.go` file in your project, called [`packages.Load`](https://pkg.go.dev/golang.org/x/tools/go/packages#Load) to parse the syntax tree, and generated mocks for every interface found in the file. The new behavior instead simply grabs the list of packages to load from the config file, or in the case of `#!yaml recursive: True`, walks the filesystem tree to discover the packages that exist (without actually parsing the files). Using this list, it calls `packages.Load` once with the list of packages that were discovered.
101+
The legacy behavior iterated over every `.go` file in your project, called [`packages.Load`](https://pkg.go.dev/golang.org/x/tools/go/packages#Load) to parse the syntax tree, and generated mocks for every interface found in the file. The new behavior instead simply grabs the list of packages to load from the config file, or in the case of `#!yaml recursive: True`, walks the file-system tree to discover the packages that exist (without actually parsing the files). Using this list, it calls `packages.Load` once with the list of packages that were discovered.
102102

103103
Filesystem Tree Layouts
104104
------------------------

docs/notes.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Additionally, this issue only happens when compiling mockery from source, such a
2626
Multiple Expectations With Identical Arguments
2727
-----------------------------------------------
2828

29-
There might be instances where you want a mock to return different values on successive calls that provide the same arguments. For example we might want to test this behavior:
29+
There might be instances where you want a mock to return different values on successive calls that provide the same arguments. For example, we might want to test this behavior:
3030

3131
```go
3232
// Return "foo" on the first call
@@ -37,7 +37,7 @@ assert(t, "foo", getter.Get("key"))
3737
assert(t, "bar", getter.Get("key"))
3838
```
3939

40-
This can be done by using the `.Once()` method on the mock call expectation:
40+
This can be done by using the `.Once()` method on the mock call expectation:
4141

4242
```go
4343
mockGetter := NewMockGetter(t)
@@ -53,7 +53,7 @@ mockGetter.EXPECT().Get(mock.anything).Return("foo").Times(4)
5353
mockGetter.EXPECT().Get(mock.anything).Return("bar").Times(2)
5454
```
5555

56-
Note that with proper Golang support in your IDE, all of the available methods are self-documented in auto-completion help contexts.
56+
Note that with proper Go support in your IDE, all the available methods are self-documented in autocompletion help contexts.
5757

5858
Variadic Arguments
5959
------------------
@@ -113,14 +113,14 @@ Semantic Versioning
113113
The versioning in this project applies only to the behavior of the mockery binary itself. This project explicitly does not promise a stable internal API, but rather a stable executable. The versioning applies to the following:
114114
115115
1. CLI arguments.
116-
2. Parsing of Golang code. New features in the Golang language will be supported in a backwards-compatible manner, except during major version bumps.
116+
2. Parsing of Go code. New features in the Go language will be supported in a backwards-compatible manner, except during major version bumps.
117117
3. Behavior of mock objects. Mock objects can be considered to be part of the public API.
118118
4. Behavior of mockery given a set of arguments.
119119
120120
What the version does _not_ track:
121121
122122
1. The interfaces, objects, methods etc. in the vektra/mockery package.
123-
2. Compatibility of `go get`-ing mockery with new or old versions of Golang.
123+
2. Compatibility of `go get`-ing mockery with new or old versions of Go.
124124
125125
Mocking interfaces in `main`
126126
----------------------------
@@ -135,4 +135,4 @@ This issue was first highlighted [in this GitHub issue](https://github.com/vektr
135135
136136
mockery uses the viper package for configuration mapping and parsing. Viper is set to automatically search for all config variables specified in its config struct. One of the config variables is named `version`, which gets mapped to an environment variable called `MOCKERY_VERSION`. If you set this environment variable, mockery attempts to parse it into the `version` bool config.
137137
138-
This is an unintended side-effect of how our config parsing is set up. The solution is to rename your environment variable to something other than `MOCKERY_VERSION`.
138+
This is an adverse effect of how our config parsing is set up. The solution is to rename your environment variable to something other than `MOCKERY_VERSION`.

docs/running.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ packages:
1818
# Lots more config...
1919
```
2020

21-
From anywhere within your repo, you can simply call `mockery` once and it will find your config either by respecting the `#!yaml config` path you gave it, or by searching upwards from the current working directory.
21+
From anywhere within your repo, you can simply call `mockery` once, and it will find your config either by respecting the `#!yaml config` path you gave it, or by searching upwards from the current working directory.
2222

2323
```bash
2424
mockery

0 commit comments

Comments
 (0)