dev: fix linter tests (#3128)
This commit is contained in:
parent
f48530e25e
commit
77962e9283
@ -61,7 +61,7 @@ func testSourcesFromDir(t *testing.T, dir string) {
|
||||
t.Run(filepath.Base(source), func(subTest *testing.T) {
|
||||
subTest.Parallel()
|
||||
|
||||
rel, err := filepath.Rel(dir, sources[0])
|
||||
rel, err := filepath.Rel(dir, source)
|
||||
require.NoError(t, err)
|
||||
|
||||
testOneSource(subTest, log, binPath, rel)
|
||||
|
@ -104,7 +104,17 @@ func (b *RunnerBuilder) WithRunContext(rc *RunContext) *RunnerBuilder {
|
||||
return b
|
||||
}
|
||||
|
||||
return b.WithConfigFile(rc.ConfigPath).WithArgs(rc.Args...)
|
||||
dir, err := os.Getwd()
|
||||
require.NoError(b.tb, err)
|
||||
|
||||
configPath := filepath.FromSlash(rc.ConfigPath)
|
||||
|
||||
base := filepath.Base(dir)
|
||||
if strings.HasPrefix(configPath, base) {
|
||||
configPath = strings.TrimPrefix(configPath, base+string(filepath.Separator))
|
||||
}
|
||||
|
||||
return b.WithConfigFile(configPath).WithArgs(rc.Args...)
|
||||
}
|
||||
|
||||
func (b *RunnerBuilder) WithDirectives(sourcePath string) *RunnerBuilder {
|
||||
|
Loading…
x
Reference in New Issue
Block a user