This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Allow dot-prefixed packages as valid import paths #572
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6af821f
Allow dot-prefixed packages as valid import paths
ascandella 9b9b6c1
Fix test case description
ascandella b3102f1
Add licence header to test file
ascandella fb6bacb
Move .m1p tests to dotgodir
ascandella 36b6d46
Rename vcsRoots
ascandella File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2017 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package dot | ||
|
||
// nothing to see here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1073,20 +1073,6 @@ func TestListPackages(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
// disallow/.m1p is ignored by listPackages...for now. Kept | ||
// here commented because this might change again... | ||
//"disallow/.m1p": { | ||
//P: Package{ | ||
//ImportPath: "disallow/.m1p", | ||
//CommentPath: "", | ||
//Name: "m1p", | ||
//Imports: []string{ | ||
//"github.com/golang/dep/internal/gps", | ||
//"os", | ||
//"sort", | ||
//}, | ||
//}, | ||
//}, | ||
"disallow/testdata": { | ||
P: Package{ | ||
ImportPath: "disallow/testdata", | ||
|
@@ -1280,7 +1266,7 @@ func TestListPackages(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
"skip directories starting with '.'": { | ||
"does not skip directories starting with '.'": { | ||
fileRoot: j("dotgodir"), | ||
importRoot: "dotgodir", | ||
out: PackageTree{ | ||
|
@@ -1292,13 +1278,32 @@ func TestListPackages(t *testing.T) { | |
Imports: []string{}, | ||
}, | ||
}, | ||
"dotgodir/.go": { | ||
P: Package{ | ||
ImportPath: "dotgodir/.go", | ||
Name: "dot", | ||
Imports: []string{}, | ||
}, | ||
}, | ||
"dotgodir/foo.go": { | ||
P: Package{ | ||
ImportPath: "dotgodir/foo.go", | ||
Name: "foo", | ||
Imports: []string{"sort"}, | ||
}, | ||
}, | ||
"dotgodir/.m1p": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm glad you caught these to move them, I entirely forgot they were there 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NP :) |
||
P: Package{ | ||
ImportPath: "dotgodir/.m1p", | ||
CommentPath: "", | ||
Name: "m1p", | ||
Imports: []string{ | ||
"github.com/golang/dep/internal/gps", | ||
"os", | ||
"sort", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want to try and address this -- should we only skip these dirs if we're at the root of the project? Will that cause problems for submodules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're OK ignoring it for now, though I appreciate you pointing it out. It's a very, very edge case, and trying to deal with it here would do some level-busting: a fix would equate "root of repo" with "root of project". That's something that's true 99% of the time, but isn't actually entailed by the design of the system - at least, not this far down.