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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/gps: add PruneOptions and update WriteDepTree
This commit changes gps.WriteDepTree to be a method on gps.SourceManager. It also updates the signature to accept a PruneOptions instead of a bool. The manfiest is updated to accept a new table, prune. This table defines pruning options accepted by dep. By default, dep will always prune nested vendor directories. The user can define 3 additional rules: * non-go: Prune non-Go files (will keep LICENSE & COPYING files) * go-tests: Prune Go test files * unused-packages: Prune unused Go packages from dependencies. The implementation of these flags is not part of this commit. Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
- Loading branch information
Showing
14 changed files
with
213 additions
and
141 deletions.
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
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
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
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,20 @@ | ||
// 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 gps | ||
|
||
// PruneOptions represents the pruning options used to write the dependecy tree. | ||
type PruneOptions uint8 | ||
|
||
const ( | ||
// PruneNestedVendorDirs indicates if nested vendor directories should be pruned. | ||
PruneNestedVendorDirs = 1 << iota | ||
// PruneNonGoFiles indicates if non-Go files should be pruned. | ||
// LICENSE & COPYING files are kept for convience. | ||
PruneNonGoFiles | ||
// PruneGoTestFiles indicates if Go test files should be pruned. | ||
PruneGoTestFiles | ||
// PruneUnusedPackages indicates if unused Go packages should be pruned. | ||
PruneUnusedPackages | ||
) |
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
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
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
Oops, something went wrong.