diff --git a/VERSION b/VERSION index 873ca0f..9b4b5fb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.7.0 +v2.7.1 diff --git a/service/project.go b/service/project.go index 41de24e..b4c0af4 100644 --- a/service/project.go +++ b/service/project.go @@ -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 { @@ -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 diff --git a/service/project_test.go b/service/project_test.go index e47caa1..4109127 100644 --- a/service/project_test.go +++ b/service/project_test.go @@ -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)