Commit Graph

220 Commits

Author SHA1 Message Date
30fa0717d0 fix(deps): update module golang.org/x/tools to v0.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-27 19:21:45 +00:00
f1f8ce7a54 fix(deps): update module golang.org/x/tools to v0.15.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-11-08 23:34:31 +00:00
b6ae5004ea fix(deps): update module golang.org/x/tools to v0.14.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-06 11:11:18 +00:00
e7936ebb48 chore(deps): update actions/checkout action to v4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-04 12:45:28 +00:00
598b45c53f fix(deps): update module golang.org/x/tools to v0.12.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-07 15:12:47 +00:00
4c91705260 fix(deps): update module golang.org/x/tools to v0.11.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-31 13:40:46 +00:00
c45bb6e670 fix(deps): update module golang.org/x/tools to v0.9.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-05-09 15:08:13 +00:00
f32a95a30c fix(deps): update module golang.org/x/tools to v0.9.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-05-09 11:59:47 +00:00
7d380b524e fix(deps): update module golang.org/x/tools to v0.8.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-07 15:50:49 +00:00
bcf3dab61c chore(deps): update actions/setup-go action to v4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-03-15 14:57:15 +00:00
d7e4ff5429 fix(deps): update module golang.org/x/tools to v0.7.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-03-07 16:13:40 +00:00
81dd968a32 fix(deps): update module golang.org/x/tools to v0.5.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-01-04 17:24:38 +00:00
dbf5125152 fix(deps): update module golang.org/x/tools to v0.3.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-11-09 19:31:37 +00:00
d85c88993e chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-10-26 17:51:08 +00:00
ffc9403000 fix(deps): update module golang.org/x/tools to v0.2.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-10-26 15:19:37 +00:00
a2207b25e3
Add .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-26 16:16:35 +02:00
055464f0ef
Add .drone.yml
Some checks reported errors
continuous-integration/drone Build encountered an error
2022-10-26 11:30:11 +02:00
6800928f88 Merge pull request 'Configure Renovate' (#1) from renovate/configure into main
Reviewed-on: #1
2022-10-25 20:57:17 +00:00
34cf063577 chore(deps): add renovate.json 2022-10-25 20:55:47 +00:00
Thomas Prebble
5d3d962614
fix: bump xtools to 0.1.9 to support go 1.18 (#167)
* fix: bump xtools to 0.1.9 to support go 1.18

* bump x/tools version to 0.1.10

* add go version 1.17 and 1.18 to the CI build matrix

* exclude 1.14 from macos and windows builds.

This change adds windows and macos to the matrix and excludes 1.14 from running on windows or macos. This matches the original behaviour of the CI build inverting the includes/excludes options
2022-03-18 11:14:52 +00:00
dedalusj
514e30653d
Fix issue with custom types shadowing basic types (#163)
When a custom type has a name that can shadow an in-built type, append
MoqParam to the name. Example: var name stringMoqParam for null.String.
2021-12-18 08:56:01 +05:30
Suhas Karanth
ef8b268d53
Universal binaries for macOS (#159)
A special format that contains both arm64 and amd64 executables in a single file
2021-11-14 16:39:42 +05:30
Sonia Hamilton
ab5b7bc086
Add -rm flag to remove target output file (#151)
File is removed before mock generation, if it exists. This is useful
when the mock generation is likely to fail due to some reason, for 
example, package load failure due to change in the interface being
mocked (the existing mock is no longer valid and cannot be compiled). In
such cases, the -rm flag can be used instead of manually removing the
file (which could have fixed the issue).
2021-07-11 12:05:54 +05:30
Ben Atkinson
b4465d5f96
Ignore anonymous imports when resolving import aliases (#150) 2021-07-04 08:31:46 +05:30
uji
e7d0d3b298
Update installation cmd on README for go1.16+ (#147) 2021-06-25 13:01:29 +05:30
Mat Ryer
126389e52f
Create FUNDING.yml 2021-02-14 13:29:50 +00:00
Mat Ryer
8e3e45fc59
remove unneeded file 2021-02-14 13:29:21 +00:00
Mat Ryer
c57d4fe76b
GitHub feature test for this repo 2021-02-14 13:28:54 +00:00
Mat Ryer
b54cd92254 simplified release instructions 2021-02-14 13:24:04 +00:00
Mat Ryer
6e4f50de4b fixed bug after changing version var name 2021-02-14 13:11:59 +00:00
Suhas Karanth
fe0d4f3360
Fix var name generation to avoid conflict (#145)
When the type and the package name is the same for an anonymous
parameter (ex: time.Time), and there are more than 1 such parameters,
the generated name for both was the same. And the generated code would
not be valid.

Fix the bug by ensuring the parameter name does not conflict with
package imports first before checking against other parameter names.
2021-02-14 13:10:16 +00:00
Mat Ryer
9a74351eb1
made Version exported to match .goreleaser config.
addresses #143
2021-02-14 13:07:18 +00:00
Mat Ryer
98d503a331
Removed credit line given major contributrions 2021-02-01 19:22:42 +00:00
Suhas Karanth
2ae606f132
Internal registry for disambiguated imports, vars (#141)
* Internal registry for disambiguated imports, vars
- Move functionality in the moq package partially into
  internal/{registry,template}.
- Leverage registry to assign unique package and variable/method
  parameter names. Use import aliases if present in interface source
  package.
BREAKING CHANGE: When the interface definition does not mention the
parameter names, the field names in call info anonymous struct will be
different.
The new field names are generated using the type info (string -> s,
int -> n, chan int -> intCh, []MyType -> myTypes, map[string]int ->
stringToInt etc.).
For example, for a string parameter previously if the field name was
'In1', the new field could be 'S' or 'S1' (depends on number of
string method parameters).
* Refactor golden file tests to be table-driven
* Fix sync pkg alias handling for moq generation
* Improve, add tests (increase coverage)
* Use $.Foo in template, avoid declaring variables
$ is set to the data argument passed to Execute, that is, to the
starting value of dot.
Variables were declared to be able to refer to the parent context.
* Consistent template field formatting
* Use tabs in generated Godoc comments' example code
* Minor simplification
* go generate
* Fix conflict for generated param name of pointer type

Excellent work by @sudo-suhas.
2021-02-01 19:20:20 +00:00
Isaev Ivan
b052143b5a
Fix gosec vulnerabilities: file and directory permissions (#142)
- Fix G301: Poor file permissions used when creating a directory.
- Fix G306: Poor file permissions used when writing to a new file.

See https://github.com/securego/gosec#available-rules
2020-12-13 09:21:03 +05:30
Mat Ryer
0d9680fd45 small readme tweak 2020-09-18 09:58:15 +01:00
Mat Ryer
171f1993f4 small edit: word wrap 2020-09-18 09:53:31 +01:00
Mat Ryer
ca877b5ffb TABS 2020-09-18 09:52:55 +01:00
Lucas Bremgartner
2ea33710f3
Print version with -version flag (#138)
Co-authored-by: Mat Ryer <matryer@users.noreply.github.com>
2020-09-18 09:16:40 +01:00
Umputun
be64288727
add skip-ensure flag to avoid import cycle (#140)
For mocks generated outside of the tested package with tests lives inside the same package as the tested code (i.e. pkg_test not used) --skip-ensure suppresses import of the source pkg

https://github.com/matryer/moq/issues/139

fix typo in readme
2020-09-17 09:49:08 +01:00
matryer
a69ca93dec ignored dist folder 2020-09-02 10:36:09 +01:00
matryer
545b7d74ae fixed whitespace 2020-09-02 10:34:06 +01:00
matryer
9581d77413 testing releasing 2020-09-02 10:30:40 +01:00
Suhas Karanth
720d53e65d Run go generate
Minor changes to generated test file because of c5b1da6 (#128).
2020-08-16 16:55:11 +05:30
Suhas Karanth
005b899ec8
Add noop formatter as an option (#133)
Useful to print the generated source code for debugging.
2020-08-16 12:55:01 +05:30
Suhas Karanth
e3d1bd8a7e Update README for stub flag 2020-08-16 12:29:28 +05:30
Suhas Karanth
83ab8dd79f
Add -stub flag to stub func implementation (#132)
When a mock is generated with the flag enabled, it introduces the
following changes:
- Does not panic on calling the method without a mock implementation.
- Return zero values iff the implementation is not provided and the
  method has return parameters.

Co-authored-by: Scott Leuthaeuser <scott_leuthaeuser@homedepot.com>
2020-08-16 12:24:12 +05:30
Suhas Karanth
24883c20a6
Use fallback name for parameter when name is _ (#131) 2020-08-16 12:16:52 +05:30
Suhas Karanth
70fed06ee3
Check errors on loading package (#130) 2020-08-16 12:10:38 +05:30
Suhas Karanth
c5b1da6fe9
Move mutexes inside mock struct (#128)
Better to not be constrained by global locks when having multiple moq
instances.

Co-authored-by: Diego Bernardes <diego.bernardes@outlook.com>
2020-08-16 12:03:17 +05:30