Debian Codegraph @

build/mockery/mockery.yaml

raw
1 ######################################################################################################
2 # #
3 # Shoutrrr Mockery Configuration #
4 # #
5 # Shoutrrr: https://github.com/nicholas-fedor/shoutrrr/ #
6 # Mockery: https://vektra.github.io/mockery/latest/ #
7 # Configuration: https://vektra.github.io/mockery/latest/configuration #
8 # Mockery Major Version: 3.x.x #
9 # #
10 ######################################################################################################
11
12 ######################################################################################################
13 # Mockery Usage #
14 # #
15 # Install Mockery: #
16 # go install github.com/vektra/mockery/v3@latest #
17 # #
18 # Run CLI command from root: #
19 # mockery #
20 # #
21 # Expected Result: #
22 # Mockery will recursively traverse through configured package locations, #
23 # identify interfaces, and create 'mocks' subdirectories containing files #
24 # named for the respective interface. #
25 ######################################################################################################
26
27 ######################################################################################################
28 # Configuration Structure #
29 # #
30 # Config File Settings: Settings for locating and enabling the config file #
31 # Logging Configuration: Options for controlling output verbosity and log levels #
32 # Interface Discovery Configuration: Settings for finding and filtering interfaces to mock #
33 # Mock Generation Configuration: Options for customizing the mock generation process #
34 # File Output Configuration: Settings for naming and placing generated mock files #
35 # Template Configuration: Settings for custom templates and template-specific options #
36 # #
37 ######################################################################################################
38
39 ######################################################################################################
40 # Config File Settings #
41 ######################################################################################################
42
43 # YAML anchors placeholder for reusable configuration fragments.
44 # Define anchors here to reference in other parts of the config.
45 # Default: {}
46 # _anchors: {}
47
48 # Set the location of the mockery config file.
49 # Overrides the default search paths (.mockery.yaml, mockery.yaml in current or parent dirs).
50 # Default: ""
51 # config: ""
52
53 ######################################################################################################
54 # Logging Configuration #
55 ######################################################################################################
56
57 # Set the logging verbosity level.
58 # Options: debug (most verbose), info (standard), warn (warnings only), error (errors only).
59 # Default: info
60 # log-level: debug
61
62 ######################################################################################################
63 # Interface Discovery Configuration #
64 ######################################################################################################
65
66 # Defines the scope of packages to process for mock generation
67 # Default: null
68 packages:
69 # Top-level pkg directory, recursively includes all subpackages
70 github.com/nicholas-fedor/shoutrrr/pkg: {}
71
72 # Top-level internal directory, recursively includes all subpackages
73 github.com/nicholas-fedor/shoutrrr/internal:
74
75 # Generate mocks for all exported interfaces within specified packages or directories.
76 # When true with packages section, processes all interfaces in listed packages.
77 # Default: false
78 all: true
79
80 # Limit mock generation to interfaces matching this regex.
81 # Ignored if all: true; use with exclude-interface-regex for finer control when all: false.
82 # Default: ""
83 # include-interface-regex: ""
84
85 # Exclude interfaces matching this regex when include-interface-regex is set.
86 # Only effective with include-interface-regex and all: false; ignored otherwise.
87 # Default: ""
88 # exclude-interface-regex: ""
89
90 # Scan subdirectories recursively for interfaces within specified packages or directories.
91 # Requires all: true or specific interface targeting to generate mocks.
92 # Default: false
93 recursive: true
94
95 # Exclude specific subpackages from recursive discovery.
96 # Applies when recursive: true; uses package import paths (e.g., "pkg/subpkg").
97 # Default: []
98 exclude-subpkg-regex:
99 - "internal/testutils"
100
101 # Include auto-generated files in package discovery when true.
102 # When false, skips files matching Go's generated file convention (e.g., "// Code generated").
103 # Default: false
104 # include-auto-generated: true
105
106 ######################################################################################################
107 # Mock Generation Configuration #
108 ######################################################################################################
109
110 # Selectively enable or disable mock generation.
111 # When false, no mocks will be generated (useful for debugging or partial generation).
112 # Default: true
113 # generate: false
114
115 # Specify build tags for the generated mock files.
116 # Matches Go's build constraint syntax (e.g., "//go:build tag1 || tag2").
117 # https://pkg.go.dev/cmd/go#hdr-Build_constraints
118 # Default: ""
119 # build-tags: ""
120
121 # Customize the struct name of the generated mock using a Go template.
122 # Overrides the default "Mock{{.InterfaceName}}" naming convention.
123 # Default: "Mock{{.InterfaceName}}"
124 # structname: ""
125
126 # Package name for generated mock files.
127 # Default: "{{.SrcPackageName}}"
128 pkgname: "mocks"
129
130 ######################################################################################################
131 # File Output Configuration #
132 ######################################################################################################
133
134 # Code formatter to use for generated mock files.
135 # Options: gofmt (standard Go formatter), goimports (includes import management), noop (no formatting).
136 # Default: goimports
137 # formatter: "goimports"
138
139 # Overwrite existing mock files when true.
140 # When false, skips files that already exist on disk.
141 # Default: false
142 # force-file-write: true
143
144 # Place mocks in the same package as the interface when true (not recommended).
145 # Avoids creating a separate package; can lead to naming conflicts.
146 # Default: null
147 # inpackage: true
148
149 # Define the output directory for mocks using a Go template.
150 # "{{.InterfaceDir}}/mocks" places mocks in a subdirectory of the interface's source dir.
151 # Default: "{{.InterfaceDir}}"
152 dir: "{{.InterfaceDir}}/mocks"
153
154 # Filename template using interface name.
155 # Default: "mocks_test.go"
156 filename: "{{.InterfaceName}}.go"
157
158 ######################################################################################################
159 # Template Configuration #
160 ######################################################################################################
161
162 # Template to use for generating mocks.
163 # Available templates: "testify" (standard testify mocks), or path to custom template.
164 # Default: ""
165 template: "testify"
166
167 # Map of template-specific options passed to the template engine.
168 # Options vary by template; commonly includes boilerplate-file for license headers.
169 # Default: {}
170 # template-data:
171 # # Specify a file containing boilerplate text (e.g., license headers) to prepend to all mocks.
172 # # Path is relative to the config file or working directory.
173 # # Default: ""
174 # boilerplate-file: ""
175
176 # JSON schema URL for validating template-data configuration.
177 # Provides validation against template-specific options.
178 # Default: "{{.Template}}.schema.json"
179 # template-schema: "{{.Template}}.schema.json"
180
181 # Fail if the template schema is unavailable when true.
182 # Ensures strict validation of template-data against the schema.
183 # Default: true
184 # require-template-schema-exists: false
185
186 # Type replacement map for substituting types in generated mocks.
187 # Keys are original types, values are replacement types.
188 # Default: {}
189 # replace-type: {}
190
191 ######################################################################################################
192 # End of Mockery Configuration #
193 ######################################################################################################