Skip to content

Commit

Permalink
Correct typos in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Jun 27, 2023
1 parent adead84 commit 62874e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ These are the configuration options available when using the legacy, non-`packag

### [`packages` config](/mockery/features/#packages-configuration)

These are the config options when using the `packages` config option. Use of the `packages` config semantics puts mockery into a completely different code path. Config variables may have changed meanings or have been substracted entirely, compared to the non-`packages` config.
These are the config options when using the `packages` config option. Use of the `packages` config semantics puts mockery into a completely different code path. Config variables may have changed meanings or have been subtracted entirely, compared to the non-`packages` config.

Please see the [features section](/mockery/features/#packages-configuration) for more details on how `packages` works, including some example configuration.

Expand Down
10 changes: 5 additions & 5 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ func (_m *Handler) HandleMessage(m pubsub.Message) error {
:octicons-tag-24: v2.21.0 · :material-test-tube: Beta Feature

!!! warning
This feature is considered beta. The feature set has been solidifed, but we are asking users to beta-test for any bugs. Use at your own risk. This warning will be updated as this feature matures.
This feature is considered beta. The feature set has been solidified, but we are asking users to beta-test for any bugs. Use at your own risk. This warning will be updated as this feature matures.

!!! info
See the [Migration Docs](/mockery/migrating_to_packages/) on how to migrate to this new feature.

Mockery has a configuration parameter called `packages`. In this config section, you define the packages and the intefaces you want mocks generated for. The packages can be any arbitrary package, either your own project or anything within the Go ecosystem. You may provide package-level or interface-level overrides to the default config you provide.
Mockery has a configuration parameter called `packages`. In this config section, you define the packages and the interfaces you want mocks generated for. The packages can be any arbitrary package, either your own project or anything within the Go ecosystem. You may provide package-level or interface-level overrides to the default config you provide.

Usage of the `packages` config section is desirable for mutiple reasons:
Usage of the `packages` config section is desirable for multiple reasons:

1. Up to 5x increase in mock generation speed over the legacy method
2. Granular control over interface generation, location, and file names
Expand Down Expand Up @@ -135,10 +135,10 @@ packages:
with-expecter: False # (4)!
```

1. For this package, we provide no package-level config (which means we inherit the deafults at the top-level). Since our default of `all:` is `False`, mockery will only generate the interfaces we specify. We tell it which interface to generate by using the `interfaces` section and specifying an empty map, one for each interface.
1. For this package, we provide no package-level config (which means we inherit the defaults at the top-level). Since our default of `all:` is `False`, mockery will only generate the interfaces we specify. We tell it which interface to generate by using the `interfaces` section and specifying an empty map, one for each interface.
2. There might be cases where you want multiple mocks generated from the same interface. To do this, you can define a default `config` section for the interface, and further `configs` (plural) section, one for each mock. You _must_ specify a `mockname` for the mocks in this section to differentiate them.
3. This is telling mockery to generate _all_ interfaces in the `io` package.
4. We can provide interface-specifc overrides to the generation config.
4. We can provide interface-specific overrides to the generation config.

### Templated variables

Expand Down
3 changes: 1 addition & 2 deletions docs/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal error: package without types was imported

[https://github.com/vektra/mockery/issues/475](https://github.com/vektra/mockery/issues/475)

This issue indicates an incompatability that exists with one of your cached Golang packages. The solution is to run `go clean -modcache`.
This issue indicates an incompatibility that exists with one of your cached Golang packages. The solution is to run `go clean -modcache`.

This issue also happens when compiling from source, such as with `go install`. You would not encounter this issue if using one of the installation methods that install pre-built binaries, like downloading the `.tar.gz` binaries, or through `brew install`.

Expand Down Expand Up @@ -132,4 +132,3 @@ This issue was first highlighted [in this GitHub issue](https://github.com/vektr
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.
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`.

0 comments on commit 62874e6

Please sign in to comment.