Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.7.0
v2.7.1
9 changes: 5 additions & 4 deletions service/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,9 @@ type ProjectHealth struct {
Files int
}

// scanProjects returns the stored projects, top-level storage entries
// without a marker, and marked projects with no files.
// scanProjects returns the stored projects, top-level storage directories
// without a marker, and marked projects with no files. Plain files at the
// top of projects/ (e.g. a stray .DS_Store) are ignored, not reported.
func (s *Service) scanProjects() (projects []ProjectHealth, unmarked, empty []string, err error) {
root := filepath.Join(s.repoPath, "projects")
if _, err := os.Stat(root); err != nil {
Expand Down Expand Up @@ -1335,11 +1336,11 @@ func (s *Service) scanProjects() (projects []ProjectHealth, unmarked, empty []st
return nil, nil, nil, err
}
for _, e := range entries {
name := e.Name()
// Non-directory entries (e.g. a stray .DS_Store) are not projects.
if !e.IsDir() {
unmarked = append(unmarked, name)
continue
}
name := e.Name()
hasMarker, err := dirContainsMarker(filepath.Join(root, name))
if err != nil {
return nil, nil, nil, err
Expand Down
3 changes: 3 additions & 0 deletions service/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,9 @@ func TestDoctor_FlagsUnmarkedAndEmptyProjects(t *testing.T) {
unmarkedDir := filepath.Join(projectsRoot, "legacy")
testhelpers.MakeFile(t, filepath.Join(unmarkedDir, "x.md"), "x\n")

// Ignored: a plain file at the top of projects/ is not a project.
testhelpers.MakeFile(t, filepath.Join(projectsRoot, ".DS_Store"), "junk\n")

// Empty: a marker but no stored files.
emptyDir := filepath.Join(projectsRoot, "emptied")
testhelpers.MakeDir(t, emptyDir)
Expand Down
Loading