Giter VIP home page Giter VIP logo

coverage's People

Contributors

cybershadow avatar trezona-lecomte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

coverage's Issues

Optimise for buffers across different projects

At the moment the way coverage-mode is built it redraws all of the buffers in coverage-buffer-list regardless of whether they've changed or not.

The first step towards optimising this is to only redraw buffers when the results for that project have changed. This will likely need to rely on the timestamp of the results.

results lookup against .resultset.json is case sensitive (windows)

Hi, thanks for a great plugin!

I had an issue where SimpleCov is generating .resultset.json with capital letter for drive ("C:") but coverage.el expects a lower-case value ("c:"). The case of all other characters in the file-path match, and I am able to rectify the situation by lower-casing the letter in the .resultset.json file.

I spent some time trying to patch SimpleCov so that it would generate the filenames in the expected format, but then I realised that the problem wasn't with the generated, or expected typecase, but with the means of comparison.

I modified coverage.el as follows. I don't know if you want to add this directly to your code since it may not be desired on other platforms but I provide here in case others are having similar issue.

I'm not very experienced with lisp, so there may be a neater way to do this, but for now rather than performing a straight associative lookup, it will iterate the keys and perform a case-insensitive comparison returning the first that matches.

Best,
Rob

(defun coverage-get-results-for-file (target-path result-path)
  "Return coverage for the file at TARGET-PATH from RESULT-PATH."
  (cl-coerce (cdr
              (car
               (cl-remove-if-not 'identity
                                 (mapcar (lambda (l)

;; === Begin New ===                                           
                                           (seq-find
                                             (lambda (x)
                                               (string-equal
                                                 (downcase target-path)
                                                 (downcase (symbol-name (car x)))))

                                             (cdr (assoc 'coverage l)))
;; === End New ===
;;                                           (assoc-string target-path
;;                                                         (assoc 'coverage l))
                                           )
                                         (coverage-get-json-from-file result-path)))))
             'list))

JSON results are slurped every time

Currently we re-read all of the coverage results from the .resultset.json file every time coverage-redraw-buffers is evaluated, which is every 1 second at the moment. Instead, let's check the timestamp field first and only read the results if it has changed.

Error running timer 'coverage redraw buffers'

I'm trying to run coverage on doom-emacs and am getting an error:

Error running timer ‘coverage-redraw-buffers’: (wrong-type-argument number-or-marker-p (lines . [1 1 1 1 1 nil 1 1 nil 1 nil nil nil nil 1 nil 1 4 4 nil 4 4 nil 1 nil 1 nil 2 nil nil nil nil 1 1 1 nil nil nil nil nil nil 1 nil 1 nil 1 nil nil nil 4 nil 1 nil 1 0 nil 0 nil nil nil nil nil nil 0 nil nil nil nil nil 1 nil 1 nil nil nil nil nil nil 1 nil nil nil 1 nil 1 nil nil nil])) [3 times]

The project is a standard Rails project and the .resultset.json file looks like:

 "RSpec": {
    "coverage": {
      "/home/martin/work/scentre/identity_service/app/controllers/auth0/change_email_controller.rb": {
        "lines": [
          1,
          1,
          1,
          null,
          1,
          8,
          8,
          6,
          null,
          6,
          2,
          2,
          2,
          null,
          null,
          4,
          2,
          null,
          2,
          null,
          null,
          6,
          null,
          null,
          1,
          null,
          1,
          12,
          null,
          null,
          1,
          4,
          8,
          null,
          null,
          null
        ]
      },
....

Any ideas on what the issue may be?

Search-failedd "\"timestamp\": [0-9]+") [2 times] Quit

I'm using Rails 3.2, RSpec, SimpleCov & emacs 25. When I run my tests it creates a coverage directory and it has a .resultset.json file but I'm getting this error in my Messages buffer;

Error running timer ‘coverage-redraw-buffers’: (search-failed "\"timestamp\": [0-9]+")

Different languages

Do you plan to support different languages?

I've created highlighting for jest JavaScript converage json file (probably will work also with jasmine) Take a look here https://github.com/jcubic/jest-coverage.el

What about PHP I think that I will extend my mode to include php as well (the coverage file is xml based).

Create a stable release

Please add a tag so that Melpa Stable creates a package. Currently Melpa Stable only has 0.3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.