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

Some generic error regexps match #27

Open
antifuchs opened this issue Nov 19, 2015 · 0 comments
Open

Some generic error regexps match #27

antifuchs opened this issue Nov 19, 2015 · 0 comments

Comments

@antifuchs
Copy link
Contributor

When running tests that log with a custom format, I see that go-test-mode wrongly buttonizes random lines that contain references to file names. Here's an example log line that gets fontified:

[54546|github.com/antifuch/something/storage.TestSomething 86295abcfd4c1629>3f25b6acce436923]   [err_kyyLxFeB6zZN0Nra]  /Users/asf/Hacks/go/src/github.com/antifuchs/something/controller.go:106: [trace] Couldn't perform action

I'd like to define a regexp matching the references contained in these errors, but the following doesn't cause a button to be created:

(add-to-list 'compilation-error-regexp-alist-alist
               '(go-test-my-log-format "\[err_[[:alnum:]]+\]  \\(/.+\\.go\\):\\([0-9]+\\): .*" 1 2))
  (add-to-list 'go-test-compilation-error-regexp-alist 'go-test-my-log-format)

This error doesn't match any of the regexes on go-test-compilation-error-regexp-alist-alist (but matches some referenced by the default compilation-error-regexp-alist). As a workaround, I've started doing this:

(add-to-list 'go-test-mode-hook
               (defun asf--go-test-mode-setup-hook ()
                 (add-to-list (make-local-variable 'compilation-error-regexp-alist) 'go-test-my-log-format)))

...and this aligns regexes to correctly buttonize this output; This leads me to suspect gotest picks up the default error regexps from compilation-error-regexp-alist. Is this workaround what I should be doing?

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