AdamNiederer / AdamNiederer/cov

buffer-local values for `cov-lcov-project-root`

未關閉
#62 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Emacs Lisp
星號
96
分支
20
PR 合併指標
30 天內沒有已合併 PR

描述

hi there,

#60 introduced `cov-lcov-project-root` as a `defvar`, but I often find myself working in monorepo projects where different sub-packages have different coverage files in different locations. I'd like to open a PR to define `cov-lcov-project-root` as buffer-local but I'm not sure what the best way is to accomplish that.

simply changing `(defvar cov-lcov-project-root)` to `(defvar-local cov-lcov-project-root)` is not sufficient, because parsing of lcov files is done in a temp buffer (in `cov--read-and-parse`) which needs access to that variable in order to map lcov SF paths to files on disk (in `cov--lcov-parse`).

the easiest thing to do would be to modify `cov--read-and-parse` to check the value of `format` and, if eq to `'lcov`, set some additional buffer-local variables. another solution might be to use something like [inheritenv](https://github.com/purcell/inheritenv) to automatically propagate _all_ buffer-local variables from the user's source buffer into the parser's temp buffer. there are probably other solutions too.

I figured I'd ask for advice before opening a PR, so I don't waste your time reviewing code which isn't what you'd prefer in terms of approach, so any input you had here would be welcome.

thanks!

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。