question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for incremental scanning of files (only scan the files that were modified since last run)

See original GitHub issue

Running eslint thru a large code base takes something about from 6 to 8 seconds (depending on the amount of code in the files and how bad the code is in the first place)

Using a cache layer that remembers that files were not modified since last time they were considered valid hugely reduces the amount of time that the process take, depending on the number of files modified.

On a regular basis for a given feature only a handful of files are modified so having a way to execute the tool only on those files might save some time.

I have written a cli wrapper over eslint that does that, but having that into the eslint module would be really nice:

This is an example of the tool executed over one of the folders of the project


# first run will take as much time as normal
eslinter 'src/**/*.js' 

>> config: .eslintrc
>> cache: true, format: eslint-friendly-formatter
>> Total files: 255, files to process: 255
>> Eslint validation complete. No errors found
>> time it took:  6539ms

# second and subsequent execution will operate only on changed files
eslinter 'src/**/*.js' 

>> config: .eslintrc
>> cache: true, format: eslint-friendly-formatter
>> Total files: 255, files to process: 4
>> Eslint validation complete. No errors found
>> time it took:  292ms

So as you see actually know which files changed makes a difference in the time it takes

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:25 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
royriojascommented, Apr 15, 2017

@dawsbot not sure I understand your question, but Eslint does support storing the cache in external locations.

Caching:
  --cache                      Only check changed files - default: false
  --cache-file path::String    Path to the cache file. Deprecated: use --cache-location - default: .eslintcache
  --cache-location path::String  Path to the cache file or directory
0reactions
IanVScommented, Feb 5, 2018

That’s an interesting point. If the file hasn’t changed, it seems like we should be able to use the results of the previous cached run, regardless if there were errors or not. The only files that really need to be linted are new files and files that have been changed. I think the proposal should probably be its own issue though, as this is an old, closed issue. Would you mind opening a new one and tagging me on it, @galvarez421?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How incremental scan for Endpoint Discover works - TechDocs
Phase 1: Completes the previous incomplete scan. Phase 2: Scans only the files that are added or modified since the last checkpoint. For ......
Read more >
Features of incremental scan - Kaspersky Knowledge Base
Incremental (partial) scan is a type of file scan during which the application only scans files that have been modified since the previous...
Read more >
Incremental analysis for Java - HCL Product Documentation
When incremental analysis is enabled, analysis data is cached by AppScan Source. ... incremental scanning, if percentage of files being changed since last...
Read more >
Start-AIPScan (AzureInformationProtection) | Microsoft Docs
The scanner initiates a full scan of all the files, even if they have been scanned before and the Azure Information Protection policy...
Read more >
Scan List/Actions - Checkmarx Knowledge Center - Confluence
Incremental scan is used to increase the scanning speed of the project. It works by scanning only the code that has changed since...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found