Modify

Ticket #209 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

Cache the results of PHPLintTask so as to not check unmodified files

Reported by: php@… Owned by: mrook
Priority: minor Milestone: 2.4.0RC1
Component: phing-tasks-system Version: 2.3.0
Keywords: phplint, lint Cc:

Description

Our particular build strategy is as follows:

  • build depends upon clean, lint
  • build assembles files for web-visibility
  • build calls smoketest
  • build is called after each update

So, a developer makes a change, runs "phing build", which does a clean, a lint, then builds the files in the right web directory, and finally runs some smoke tests. The source code often contains third party libraries that we usually don't touch. Sometimes these libraries have hundreds of files.

Linting all of these third-party source files each and every time seriously hurts our cycle time: sometimes 20-30 seconds are added. It would be very nice for the PHPLintTask to remember which files it's already linted and only lint those that have been modified. Even build cycles that aren't as frequent as ours could benefit from caching (why work if you don't have to).

I suppose the cache directory should be a part of the lint element. Like this:

<phplint haltonfailure="true" cachefile="/tmp/phplintcache"> ... </phplint>

When cachefile is absent, phplint behaves as it does currently. When present, phplint checks to see if the file has been modified since last cache and lints if so, then stores file name and modification time into cache file after a successful lint.

If this is a reasonable approach, and an approved ticket, we can implement. Just give us the green light.

Attachments

Change History

comment:1 Changed 4 years ago by mrook

  • Owner changed from hans to mrook
  • Status changed from new to assigned

Hi, implementing a caching strategy to the lint task is definitely a good idea; a patch would be appreciated!

comment:2 Changed 2 years ago by mrook

(In [543]) Refs #209 - add caching ability to phplint and jsllint tasks

comment:3 Changed 2 years ago by mrook

  • Status changed from assigned to closed
  • Resolution set to fixed

As of r543, both phplint and jsllint use a new class 'DataStore', which is nothing more than a serialized key/value store committed to disk.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.