Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage: cover.cov location is not based on the current file's path #527

Open
maruel opened this issue Nov 21, 2024 · 0 comments
Open

Comments

@maruel
Copy link

maruel commented Nov 21, 2024

Related to issue #526.

lua/go/coverage.lua hardcodes "cover.cov" in the current working directory and not in the directory containing of the active buffer's file path.

Ref:

This is problematic for two reasons:

  • When opening a file in a subdirectory, the file is not in the right location. E.g. nvim foo/bar.go will create cover.cov in the current directory, not under foo/.
    • Similar wrong behavior if running nvim ../foo/bar.go
  • This file has to be ignored in git.

Solution

One of:

  • Default to a temporary file that is automatically cleaned up upon editor exit
  • Use a well known location in ~/.cache/
  • Use the file's current directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant