source-foundry / code-corpora

Source code corpora for text analysis
Other
29 stars 6 forks source link

Add Rust source #9

Closed chrissimpkins closed 6 years ago

chrissimpkins commented 6 years ago

@burodepeper David, I added Rust source to the collection and attempted to add the rust directory to your analyze.js script. I don't believe that my change caused this issue but I am seeing the following error when I attempt to execute it with node analyze.js from the scripts directory (node v10.3.0):

Loading language 'c'...
fs.js:143
    throw err;
    ^

Error: ENOTDIR: not a directory, scandir '../c/.DS_Store'
    at Object.fs.readdirSync (fs.js:893:3)
    at App.loadProject (/Users/ces/Desktop/code/code-corpora/scripts/lib/app.js:45:22)
    at projects.forEach.project (/Users/ces/Desktop/code/code-corpora/scripts/lib/app.js:28:40)
    at Array.forEach (<anonymous>)
    at App.loadLanguage (/Users/ces/Desktop/code/code-corpora/scripts/lib/app.js:28:16)
    at languages.forEach.language (/Users/ces/Desktop/code/code-corpora/scripts/analyze.js:39:7)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/ces/Desktop/code/code-corpora/scripts/analyze.js:38:11)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)

Thoughts?

burodepeper commented 6 years ago

Your Mac (technically, I believe Finder did it) added a .DS_Store file to the C folder, and most likely others as well: Error: ENOTDIR: not a directory, scandir '../c/.DS_Store'. The script assumes (my bad ;) that everything in one of the top-level directories is a directory.

Fixed it in https://github.com/source-foundry/code-corpora/commit/231787181957bd08c880320f40e2a585207341a7

chrissimpkins commented 6 years ago

@burodepeper ty! and thanks for the fix