Feature Request - Skip Unmodified Files

28 views
Skip to first unread message

Mark Dreyer

unread,
Jul 29, 2013, 1:39:50 PM7/29/13
to closure-lin...@googlegroups.com
For large javascript applications, it would be helpful for the linter to skip files that have not been modified since the last time closure linter ran. Similar to how a compiler works.

We have a large js codebase and it seems inefficient to run the linter on every single file when only a few were changed.  This could be accomplished with some sort of script that records the last run time and compares that with the last modified date, but I think this could be a useful feature in the linter itself.

Nathan Naze

unread,
Jul 29, 2013, 2:44:10 PM7/29/13
to closure-lin...@googlegroups.com
Because this logic differs per setup, this is normally done inside Google by an external mechanism, and then calling into gjslint with "changed files", as in:

gjslint [changed file 1] [changed file 2] ...

Nathan


On Mon, Jul 29, 2013 at 1:39 PM, Mark Dreyer <dre...@gmail.com> wrote:
For large javascript applications, it would be helpful for the linter to skip files that have not been modified since the last time closure linter ran. Similar to how a compiler works.

We have a large js codebase and it seems inefficient to run the linter on every single file when only a few were changed.  This could be accomplished with some sort of script that records the last run time and compares that with the last modified date, but I think this could be a useful feature in the linter itself.

--
You received this message because you are subscribed to the Google Groups "Closure Linter Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-linter-di...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tyler Breisacher

unread,
Jul 29, 2013, 2:47:07 PM7/29/13
to closure-lin...@googlegroups.com
If you're using git, the easiest non-Google-internal way to do this might be to write a pre-commit hook that runs the linter just on files that have changed in a particular commit. Other version control tools probably have similar systems.

Mark Dreyer

unread,
Jul 30, 2013, 8:59:32 PM7/30/13
to closure-lin...@googlegroups.com
Thanks for the suggestions and the quick replies. I was able to edit our ant build scripts to get only the modified files and pass them into gjslint like so:

        <!-- Get js files modified since last time we ran gjslint -->
        <fileset dir="${js-src}" id="unlinted.files.ref">
            <include name="**" /><!-- All Sub-directories -->
            <include name="*.js" />
            <date datetime="${gjslintTimestamp}" pattern="${tstamp.pattern}" when="after"/>
        </fileset>
        <pathconvert property="unlinted.files" refid="unlinted.files.ref" pathsep=" " />

Upon successful lint, the gjslintTimestamp build property gets updated.
Reply all
Reply to author
Forward
0 new messages