Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit ee72b5f

Browse files
committed
Address PR comments:
- casing in error message - whole sentences in comments - remove merging or required packages - omit underscore values in ranges
1 parent baf1731 commit ee72b5f

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

manifest.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var (
3333
errInvalidMetadata = errors.New("metadata should be a TOML table")
3434

3535
errInvalidProjectRoot = errors.New("ProjectRoot name validation failed")
36-
errInefficientRules = errors.New("Inefficient rules found in the manifest")
36+
errInefficientRules = errors.New("inefficient rules found in the manifest")
3737

3838
errInvalidPruneValue = errors.New("prune options values must be booleans")
3939
errPruneSubProject = errors.New("prune projects should not contain sub projects")
@@ -326,7 +326,7 @@ func ValidateProjectRoots(c *Ctx, m *Manifest, sm gps.SourceManager) error {
326326
}
327327

328328
// ValidatePackageRules ensure that there are no ineffectual package declarations
329-
// in the constraints, overrides, required, and ignored rules in the manifest.
329+
// in the constraints, overrides, and ignored rules in the manifest.
330330
func ValidatePackageRules(c *Ctx, proj *Project, sm gps.SourceManager) (err error) {
331331
directDeps, err := proj.DirectDependencies(sm)
332332
if err != nil {
@@ -357,25 +357,19 @@ func ValidatePackageRules(c *Ctx, proj *Project, sm gps.SourceManager) (err erro
357357
}
358358

359359
// FindIneffectualConstraints looks for constraints decleared in the project
360-
// manifest that aren't directly used in the project. Required packages are an
361-
// exception to this check.
360+
// manifest that aren't directly used in the project.
362361
func FindIneffectualConstraints(m *Manifest, directDeps map[string]bool) []gps.ProjectRoot {
363-
// Treat required packages as if they were direct dependencies
364-
for pr, _ := range m.RequiredPackages() {
365-
directDeps[string(pr)] = true
366-
}
367-
368362
ineffectuals := make([]gps.ProjectRoot, 0)
369-
// Check constraints
363+
// Check constraints in the manifest.
370364
pc := m.DependencyConstraints()
371-
for pr, _ := range pc {
365+
for pr := range pc {
372366
if !directDeps[string(pr)] {
373367
ineffectuals = append(ineffectuals, pr)
374368
}
375369
}
376370

377-
// Check overrides as well
378-
for pr, _ := range m.Overrides() {
371+
// Check overrides in the manifest.
372+
for pr := range m.Overrides() {
379373
if !directDeps[string(pr)] {
380374
ineffectuals = append(ineffectuals, pr)
381375
}

0 commit comments

Comments
 (0)