Search code examples
gitcodekit

Why does Codekit complain about 10K files when I don't have 10K files in a project?


Mac OS has an inbuilt limit of 10,000 files, so Codekit produces a warning if a folder has more than 10,000 files.

Maximum Item Limit Exceeded. CodeKit can watch up to 10140 items simultaneously, which is the limit imposed by Mac OS X. The app is currently watching 10132 items and 12 new items were found while refreshing the project or framework 'SocialAppsT'. These items were not added. Reduce the number of items in CodeKit and click the refresh button.

I have under 2000 files excluding .git folder:

~/Documents/SomeProject: find . -path ./.git -prune -o -print | wc -l
1966

Including the git folder (which Codekit should ignore by default) I have 7000 files.

~/Documents/SomeProject: find .  -print | wc -l
7064

How can I stop these warnings and made Codekit work on this project?


Solution

  • Check your project files for symlink references to local files, which in some cases seems to cause CodeKit to loop on adding those files.

    One example from a recent project of mine:

    index.php -> run-all-tests.php
    run-all-tests.php
    

    This resulted in CodeKit adding run-all-tests.php thousands of times. I suspect that it may only result if the natural file ordering places the symlink before the real file, or if it is in the same folder (as I don't see it happen in all cases).

    To fix: remove the symlink, or you can exclude the file/folders from compilation.