mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Ignore home directory paths
This commit is contained in:
@@ -102,6 +102,10 @@ func gotDashF(line int, fields []string, fieldNum int) error {
|
||||
// Same-dir files are usually created in the same example
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(target, "~/") {
|
||||
// Home directory may also be created by the same example
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(target, "/") {
|
||||
// Absolute paths tend to be /tmp/* and created in the same example.
|
||||
return nil
|
||||
|
@@ -82,6 +82,10 @@ func TestKubectlDashF(t *testing.T) {
|
||||
"Foo\n```\nkubectl -blah create -f/foobar\n```\nBar",
|
||||
true,
|
||||
},
|
||||
{
|
||||
"Foo\n```\nkubectl -blah create -f~/foobar\n```\nBar",
|
||||
true,
|
||||
},
|
||||
// Real checks
|
||||
{
|
||||
"Foo\n```\nkubectl -blah create -f mungedocs.go\n```\nBar",
|
||||
|
Reference in New Issue
Block a user