Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exclude-regex to config #720

Merged
merged 3 commits into from
Oct 16, 2023
Merged

Conversation

kbolino
Copy link
Contributor

@kbolino kbolino commented Oct 9, 2023

Description

Adds exclude-regex to the configuration, which has the inverse effect as include-regex. I decided to only honor exclude-regex if include-regex was also set, but that decision is not necessarily the correct one; it merely simplifies the logic in the code.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Version of Golang used when building/testing:

  • 1.11
  • 1.12
  • 1.13
  • 1.14
  • 1.15
  • 1.16
  • 1.17
  • 1.18
  • 1.19
  • 1.20
  • 1.21

How Has This Been Tested?

There are fairly comprehensive unit test cases added to TestConfig_ShouldGenerateInterface in pkg/config/config_test.go.

However I could not compute test coverage because I get a stack overflow panic from an unrelated test, which also occurs on master before my change (details below).

Stack traces are inconsistent, but here is the output including logs and what I think is the most relevant goroutine stack:

> cd pkg/config
> go test -v -run TestConfig_Initialize/test_with_one_subpackage,_config_not_defined
=== RUN   TestConfig_Initialize
=== RUN   TestConfig_Initialize/test_with_one_subpackage,_config_not_defined
09 Oct 23 17:03 EDT DBG config map is nil, reading: C:\Users\kbolino\AppData\Local\Temp\TestConfig_Initializetest_with_one_subpackage,_config_not_defined1079613362\001\config.yaml version=v0.0.0-dev
09 Oct 23 17:03 EDT DBG package cache is nil version=v0.0.0-dev
09 Oct 23 17:03 EDT DBG config section not provided for package version=v0.0.0-dev
09 Oct 23 17:03 EDT DBG discovering sub-packages package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 version=v0.0.0-dev
09 Oct 23 17:03 EDT DBG subdirectory has a .go file, adding this path to packages config package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 path="C:\\Users\\kbolino\\GolandProjects\\mockery\\pkg\\fixtures\\example_project\\pkg_with_subpkgs\\subpkg2\\subpkg3" version=v0.0.0-dev
09 Oct 23 17:03 EDT DBG adding sub-package config package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 sub-package="github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\\subpkg3" version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC adding sub-package to config map package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 parent-package=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 sub-package="github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\\subpkg3" version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC getting config package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 parent-package=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 sub-package="github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\\subpkg3" version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC getting packages section package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 parent-package=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 sub-package="github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\\subpkg3" version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC sub-package doesn't exist in config package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 parent-package=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 sub-package="github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\\subpkg3" version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC done discovering recursive packages version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC merging in config version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC getting packages version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC getting default config version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC merging for package package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2 version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC merging for package package-path=github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2/subpkg3 version=v0.0.0-dev
09 Oct 23 17:03 EDT TRC merging for package package-path="github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\\subpkg3" version=v0.0.0-dev
runtime: VirtualAlloc of 10686963712 bytes failed with errno=1455
fatal error: out of memory

runtime stack:
runtime.throw({0x7c6963?, 0xc68370d000?})
        C:/Program Files/Go/src/runtime/panic.go:1077 +0x65 fp=0x8dccbff988 sp=0x8dccbff958 pc=0x34d745
runtime.sysUsedOS(0xc66a90a000, 0x27cfe2000)
        C:/Program Files/Go/src/runtime/mem_windows.go:83 +0x1bb fp=0x8dccbff9e8 sp=0x8dccbff988 pc=0x32adbb
runtime.sysUsed(...)
        C:/Program Files/Go/src/runtime/mem.go:77
runtime.(*mheap).allocSpan(0xb48ca0, 0x13e7f1, 0x0, 0xaa?)
        C:/Program Files/Go/src/runtime/mheap.go:1351 +0x487 fp=0x8dccbffa88 sp=0x8dccbff9e8 pc=0x33c467
runtime.(*mheap).alloc.func1()
        C:/Program Files/Go/src/runtime/mheap.go:968 +0x5c fp=0x8dccbffad0 sp=0x8dccbffa88 pc=0x33bc1c
runtime.systemstack()
        C:/Program Files/Go/src/runtime/asm_amd64.s:509 +0x49 fp=0x8dccbffae0 sp=0x8dccbffad0 pc=0x37f989

goroutine 7 [running]:
runtime.systemstack_switch()
        C:/Program Files/Go/src/runtime/asm_amd64.s:474 +0x8 fp=0xc00d7e3638 sp=0xc00d7e3628 pc=0x37f928
runtime.(*mheap).alloc(0x27cfe2000?, 0x13e7f1?, 0x20?)
        C:/Program Files/Go/src/runtime/mheap.go:962 +0x5b fp=0xc00d7e3680 sp=0xc00d7e3638 pc=0x33bb7b
runtime.(*mcache).allocLarge(0xc00d7e3747?, 0x27cfe2000, 0x50?)
        C:/Program Files/Go/src/runtime/mcache.go:234 +0x85 fp=0xc00d7e36c8 sp=0xc00d7e3680 pc=0x329c85
runtime.mallocgc(0x27cfe2000, 0x0, 0x0)
        C:/Program Files/Go/src/runtime/malloc.go:1123 +0x4f6 fp=0xc00d7e3730 sp=0xc00d7e36c8 pc=0x321116
runtime.growslice(0xc46cf8a000, 0x3?, 0x8?, 0x0?, 0xc006e83c20?)
        C:/Program Files/Go/src/runtime/slice.go:266 +0x4cf fp=0xc00d7e37a0 sp=0xc00d7e3730 pc=0x36398f
gopkg.in/yaml%2ev3.yaml_string_write_handler(0xc000080400, {0xc0000b6200, 0x7b, 0x0?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/apic.go:122 +0x5b fp=0xc00d7e37f0 sp=0xc00d7e37a0 pc=0x60597b
gopkg.in/yaml%2ev3.yaml_emitter_flush(0xc000080400)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/writerc.go:43 +0x47 fp=0xc00d7e3828 sp=0xc00d7e37f0 pc=0x633847
gopkg.in/yaml%2ev3.put(0xc000080400, 0x20)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/emitterc.go:40 +0x2a fp=0xc00d7e3848 sp=0xc00d7e3828 pc=0x60cf2a
gopkg.in/yaml%2ev3.yaml_emitter_write_indent(0xc000080400)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/emitterc.go:1506 +0xb3 fp=0xc00d7e3870 sp=0xc00d7e3848 pc=0x6126f3
gopkg.in/yaml%2ev3.yaml_emitter_emit_block_mapping_key(0xc000080400, 0xc006e83d30, 0x0?)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/emitterc.go:781 +0x225 fp=0xc00d7e38d0 sp=0xc00d7e3870 pc=0x60fae5
gopkg.in/yaml%2ev3.yaml_emitter_state_machine(0xc000080400?, 0xc006e83d30?)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/emitterc.go:303 +0x132 fp=0xc00d7e38f8 sp=0xc00d7e38d0 pc=0x60dbd2
gopkg.in/yaml%2ev3.yaml_emitter_emit(0xc000080400, 0xc0006ca360?)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/emitterc.go:153 +0x1c5 fp=0xc00d7e3a68 sp=0xc00d7e38f8 pc=0x60d645
gopkg.in/yaml%2ev3.(*encoder).emit(0xc000080400)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:81 +0x25 fp=0xc00d7e3a88 sp=0xc00d7e3a68 pc=0x614f45
gopkg.in/yaml%2ev3.(*encoder).emitScalar(0xc000080400, {0xc00000b640, 0x9}, {0x0?, 0x98?}, {0x0?, 0xc000032d30?}, 0x2, {0x0, 0x0, ...}, ...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:425 +0x487 fp=0xc00d7e3c40 sp=0xc00d7e3a88 pc=0x617d27
gopkg.in/yaml%2ev3.(*encoder).stringv(0xc000080400, {0x0, 0x0}, {0x738560?, 0xc000833590?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:362 +0x405 fp=0xc00d7e3d88 sp=0xc00d7e3c40 pc=0x616f25
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x738560?, 0xc000833590?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:172 +0x87f fp=0xc00d7e3f00 sp=0xc00d7e3d88 pc=0x615abf
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:191 +0xa5 fp=0xc00d7e3f98 sp=0xc00d7e3f00 pc=0x615d65
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc00d7e4220)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc00d7e40e0 sp=0xc00d7e3f98 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192270?, 0x328fe8?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc00d7e4258 sp=0xc00d7e40e0 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc000833550?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc00d7e43d0 sp=0xc00d7e4258 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc00d7e4468 sp=0xc00d7e43d0 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc00d7e46f0)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc00d7e45b0 sp=0xc00d7e4468 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192240?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc00d7e4728 sp=0xc00d7e45b0 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc000833520?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc00d7e48a0 sp=0xc00d7e4728 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc00d7e4938 sp=0xc00d7e48a0 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc00d7e4bc0)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc00d7e4a80 sp=0xc00d7e4938 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192210?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc00d7e4bf8 sp=0xc00d7e4a80 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0008334d0?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc00d7e4d70 sp=0xc00d7e4bf8 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc00d7e4e08 sp=0xc00d7e4d70 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc00d7e5090)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc00d7e4f50 sp=0xc00d7e4e08 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192120?, 0x328fe8?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc00d7e50c8 sp=0xc00d7e4f50 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc000833450?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc00d7e5240 sp=0xc00d7e50c8 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc00d7e52d8 sp=0xc00d7e5240 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc00d7e5560)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc00d7e5420 sp=0xc00d7e52d8 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc0001922a0?, 0x1e1fc7fde08?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc00d7e5598 sp=0xc00d7e5420 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0008333f0?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc00d7e5710 sp=0xc00d7e5598 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc00d7e57a8 sp=0xc00d7e5710 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc00d7e5a30)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc00d7e58f0 sp=0xc00d7e57a8 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192210?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc00d7e5a68 sp=0xc00d7e58f0 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc000833240?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc00d7e5be0 sp=0xc00d7e5a68 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc00d7e5c78 sp=0xc00d7e5be0 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc00d7e5f00)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc00d7e5dc0 sp=0xc00d7e5c78 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192120?, 0x328fe8?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc00d7e5f38 sp=0xc00d7e5dc0 pc=0x615a39
...178951 frames elided...
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f30a8 sp=0xc0101f3010 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc000263330)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f31f0 sp=0xc0101f30a8 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc0001922a0?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f3368 sp=0xc0101f31f0 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a9bb0?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f34e0 sp=0xc0101f3368 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f3578 sp=0xc0101f34e0 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc000263800)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f36c0 sp=0xc0101f3578 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192210?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f3838 sp=0xc0101f36c0 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a9a40?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f39b0 sp=0xc0101f3838 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f3a48 sp=0xc0101f39b0 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc000263cd0)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f3b90 sp=0xc0101f3a48 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192120?, 0x328fe8?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f3d08 sp=0xc0101f3b90 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a99c0?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f3e80 sp=0xc0101f3d08 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f3f18 sp=0xc0101f3e80 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc0002641a0)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f4060 sp=0xc0101f3f18 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc0001922a0?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f41d8 sp=0xc0101f4060 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a9990?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f4350 sp=0xc0101f41d8 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f43e8 sp=0xc0101f4350 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc000264670)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f4530 sp=0xc0101f43e8 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192210?, 0x1e1fc5617a8?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f46a8 sp=0xc0101f4530 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a9820?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f4820 sp=0xc0101f46a8 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f48b8 sp=0xc0101f4820 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc000264b40)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f4a00 sp=0xc0101f48b8 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192120?, 0x328fe8?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f4b78 sp=0xc0101f4a00 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a97a0?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f4cf0 sp=0xc0101f4b78 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f4d88 sp=0xc0101f4cf0 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc000265010)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f4ed0 sp=0xc0101f4d88 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc0001922a0?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f5048 sp=0xc0101f4ed0 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a9770?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f51c0 sp=0xc0101f5048 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f5258 sp=0xc0101f51c0 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc0002654e0)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f53a0 sp=0xc0101f5258 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192210?, 0x637d7b?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f5518 sp=0xc0101f53a0 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x74c8a0?, 0xc0000a9600?, 0x98?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x785 fp=0xc0101f5690 sp=0xc0101f5518 pc=0x6159c5
gopkg.in/yaml%2ev3.(*encoder).marshal.(*encoder).mapv.func1()
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:192 +0xe5 fp=0xc0101f5728 sp=0xc0101f5690 pc=0x615da5
gopkg.in/yaml%2ev3.(*encoder).mappingv(0xc000080400, {0x0?, 0x0}, 0xc0002659b0)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0x14a fp=0xc0101f5870 sp=0xc0101f5728 pc=0x6166aa
gopkg.in/yaml%2ev3.(*encoder).mapv(...)
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:187
gopkg.in/yaml%2ev3.(*encoder).marshal(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192120?, 0xc000265a38?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:164 +0x7f9 fp=0xc0101f59e8 sp=0xc0101f5870 pc=0x615a39
gopkg.in/yaml%2ev3.(*encoder).marshalDoc(0xc000080400, {0x0, 0x0}, {0x755c80?, 0xc000192120?, 0xc000192270?})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:105 +0x12e fp=0xc0101f5a48 sp=0xc0101f59e8 pc=0x61518e
gopkg.in/yaml%2ev3.Marshal({0x755c80, 0xc000192120})
        C:/Users/kbolino/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/yaml.go:222 +0x308 fp=0xc0101f5d78 sp=0xc0101f5a48 pc=0x6344c8
github.com/vektra/mockery/v2/pkg/config.TestConfig_Initialize.func1(0xc000053d40)
        C:/Users/kbolino/GolandProjects/mockery/pkg/config/config_test.go:1114 +0x3ba fp=0xc0101f5f70 sp=0xc0101f5d78 pc=0x70989a
testing.tRunner(0xc000053d40, 0xc000032a50)
        C:/Program Files/Go/src/testing/testing.go:1595 +0xff fp=0xc0101f5fc0 sp=0xc0101f5f70 pc=0x44251f
testing.(*T).Run.func1()
        C:/Program Files/Go/src/testing/testing.go:1648 +0x25 fp=0xc0101f5fe0 sp=0xc0101f5fc0 pc=0x4434a5
runtime.goexit()
        C:/Program Files/Go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0101f5fe8 sp=0xc0101f5fe0 pc=0x381941
created by testing.(*T).Run in goroutine 6
        C:/Program Files/Go/src/testing/testing.go:1648 +0x3ad

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (* see above)

Feedback on the Checklist

I ran into several issues when trying to contribute:

  1. As mentioned already, there's a stack overflow panic in a test. This may be a Windows-specific issue, I don't know, but it seems to be in the YAML encoder.

  2. The README/CONTRIBUTING directions weren't really accurate for me. For one thing, go mod download -x doesn't seem to do anything. It certainly doesn't install task nor put it on my PATH. I ended up using the somewhat cumbersome go run github.com/go-task/task/v3/cmd/task instead.

  3. Nowhere do I see it mentioned that you need Python, nor that you need to set up a Python virtual environment to run pip install for mkdocs.install task.

  4. Speaking of mkdocs.install, it does not work out of the box unless I guess you have special insider access to mkdocs-material-insiders:

> go run github.com/go-task/task/v3/cmd/task mkdocs.install                       
task: [mkdocs.install] pip install -r docs/requirements.txt
Collecting mike@ git+https://github.com/jimporter/mike.git (from -r docs/requirements.txt (line 1))
  Cloning https://github.com/jimporter/mike.git to c:\users\kbolino\appdata\local\temp\pip-install-riuqlj4h\mike_6f2579f4a59d40bd9869761baa7d07eb
  Running command git clone --filter=blob:none --quiet https://github.com/jimporter/mike.git 'C:\Users\kbolino\AppData\Local\Temp\pip-install-riuqlj4h\mike_6f2579f4a59d40bd9869761baa7d07eb'
  Resolved https://github.com/jimporter/mike.git to commit f0522f245e64687dd18384fbd86b721175711474
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting git+https://****@github.com/squidfunk/mkdocs-material-insiders.git (from -r docs/requirements.txt (line 4))
  Cloning https://****@github.com/squidfunk/mkdocs-material-insiders.git to c:\users\kbolino\appdata\local\temp\pip-req-build-7hgrunmj
  Running command git clone --filter=blob:none --quiet 'https://****@github.com/squidfunk/mkdocs-material-insiders.git' 'C:\Users\kbolino\AppData\Local\Temp\pip-req-build-7hgrunmj'
  bash: /dev/tty: No such device or address
  error: failed to execute prompt script (exit code 1)
  fatal: could not read Password for 'https://${GH_TOKEN}@github.com': No such file or directory
  error: subprocess-exited-with-error

  × git clone --filter=blob:none --quiet 'https://****@github.com/squidfunk/mkdocs-material-insiders.git' 'C:\Users\kbolino\AppData\Local\Temp\pip-req-build-7hgrunmj' did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet 'https://****@github.com/squidfunk/mkdocs-material.git' 'C:\Users\kbolino\AppData\Local\Temp\pip-req-build-7hgrunmj' did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
task: Failed to run task "mkdocs.install": exit status 1
task: Failed to run task "mkdocs.install": exit status 1
exit status 201
  1. I had to replace the offending line in docs/requirements.txt:

    git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
    

    with the more forgiving (but perhaps invalid?):

    git+https://github.com/squidfunk/mkdocs-material.git
    
  2. And in the end I still couldn't run mkdocs.serve, again probably because I'm on Windows:

> go run github.com/go-task/task/v3/cmd/task mkdocs.serve  
task: Task "mkdocs.install" is up to date
task: [mkdocs.serve] mkdocs serve
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\__main__.py", line 270, in serve_command
    serve.serve(**kwargs)
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\commands\serve.py", line 59, in serve
    config = get_config()
             ^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\commands\serve.py", line 47, in get_config
    config = load_config(
             ^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\config\base.py", line 378, in load_config
    errors, warnings = cfg.validate()
                       ^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\config\base.py", line 230, in validate
    run_failed, run_warnings = self._validate()
                               ^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\config\base.py", line 188, in _validate
    self[key] = config_option.validate(value)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\config\config_options.py", line 182, in validate
    return self.run_validation(value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\config\config_options.py", line 1064, in run_validation
    self.load_plugin_with_namespace(name, cfg)
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\config\config_options.py", line 1102, in load_plugin_with_namespace
    return (name, self.load_plugin(name, config))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\GolandProjects\mockery\venv\Lib\site-packages\mkdocs\config\config_options.py", line 1120, in load_plugin
    plugin_cls = self.installed_plugins[name].load()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\AppData\Local\Programs\Python\Python312\Lib\importlib\metadata\__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kbolino\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
    raise OSError(error_message)  # pragma: no cover
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: no library called "cairo-2" was found
no library called "cairo" was found
cannot load library 'C:\Program Files (x86)\GtkSharp\2.12\bin\libcairo-2.dll': error 0xc1
cannot load library 'libcairo.so.2': error 0x7e.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'libcairo.so.2'
cannot load library 'libcairo.2.dylib': error 0x7e.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'libcairo.2.dylib'
cannot load library 'C:\Program Files (x86)\GtkSharp\2.12\bin\libcairo-2.dll': error 0xc1
task: Failed to run task "mkdocs.serve": exit status 1
task: Failed to run task "mkdocs.serve": exit status 1
exit status 201

@kbolino
Copy link
Contributor Author

kbolino commented Oct 10, 2023

About half of my issues seem to be Windows-related. I had fewer problems building on Mac. It's probably a good idea to note in README.md and/or CONTRIBUTING.md that building on Windows is not well supported. In particular, on my Mac:

  • There was no panic in any of the tests (I may track down why this happens and file an issue against go-yaml spew.Dump(c._cfgAsMap) seemed to show an infinitely nested structure, so this is probably not an issue specific to go-yaml)
  • Everything ran noticeably faster (despite the Mac being less powerful than my PC)
  • mkdocs.serve worked fine

I'd still recommend:

  • Adding a note to README.md and/or CONTRIBUTING.md to alias task='go run github.com/go-task/task/v3/cmd/task'.
  • The Taskfile should probably create a Python virtual environment if it doesn't already exist and activate it before running mkdocs.install or mkdocs.serve

I can make these changes in this or another PR if there's interest/agreement.

@kbolino
Copy link
Contributor Author

kbolino commented Oct 10, 2023

I think I've isolated the issue that causes infinite recursion but only on Windows, I will file an issue report and a PR

@LandonTClipp
Copy link
Collaborator

Thanks for the PR. Sorry your contributing experience was so fraught. I think it's definitely an opportunity for me to clarify/simplify some things. The mkdocs-material insiders thing is 100% something we can fix though.

I'll review in the coming days.

@kbolino
Copy link
Contributor Author

kbolino commented Oct 10, 2023

Cheers, a lot of my pain seems to have been self-inflicted by using Windows.

pkg/config/config.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@LandonTClipp LandonTClipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go ahead and reshuffle the existing logic to make it cleaner, no need to shoehorn the old way of doing things.

Comment on lines 288 to 302
if pkgConfig.ExcludeRegex != "" {
if pkgConfig.All {
log := zerolog.Ctx(ctx)
log.Warn().Msg("interface config has both `all` and `exclude-regex` set: `exclude-regex` will be ignored")
} else if pkgConfig.IncludeRegex == "" {
log := zerolog.Ctx(ctx)
log.Warn().Msg("interface config has `exclude-regex` set but not `include-regex`: `exclude-regex` will be ignored")
} else {
excludedByRegex, err = regexp.MatchString(pkgConfig.ExcludeRegex, interfaceName)
if err != nil {
return false, fmt.Errorf("evaluating `exclude-regex`: %w", err)
}
if excludedByRegex {
matchedByRegex = false
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say we can reorganize this code. We should have a separate section that logs the warnings like:

if pkgConfig.All {
    if pkgConfig.IncludeRegex != "" {
        log.Warn().Msg("interface config has both `all` and `include-regex` set: `include-regex` will be ignored")
    }
    if pkgConfig.ExcludeRegex != "" {
        log.Warn().Msg("interface config has both `all` and `exclude-regex` set: `exclude-regex` will be ignored")
    }
    return true
}

Then populate the matchedBy/excludedBy variables if pkgConfig.All == true

var matchedByRegex, excludedByRegex bool
if pkgConfig.IncludeRegex != "" {
    // do matching
}
if pkgConfig.ExcludeRegex != "" {
    // do matching
}
return interfaceExists || (matchedByRegex && !excludedByRegex)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken a few liberties to reduce nesting, LMK if it needs more work

Copy link
Collaborator

@LandonTClipp LandonTClipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for adding a quite comprehensive set of tests. This is golden.

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (9d79f3a) 74.91349% compared to head (25befa2) 75.44910%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@                 Coverage Diff                 @@
##              master        #720         +/-   ##
===================================================
+ Coverage   74.91349%   75.44910%   +0.53561%     
===================================================
  Files              9           9                 
  Lines           2312        2338         +26     
===================================================
+ Hits            1732        1764         +32     
+ Misses           442         438          -4     
+ Partials         138         136          -2     
Files Coverage Δ
pkg/config/config.go 69.98285% <100.00000%> (+2.47835%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LandonTClipp LandonTClipp merged commit b919710 into vektra:master Oct 16, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add exclude-regex or similar mechanism to ignore certain types
2 participants