Nixinova / LinguistJS

Analyse and list all languages used in a folder. Implementation of and powered by GitHub's Linguist.
ISC License
39 stars 12 forks source link

Vendored files are not ignored when multiple folder inputs are given #25

Closed Nixinova closed 1 year ago

Nixinova commented 1 year ago

Folders like .git etc are not ignored by default when multiple folder inputs are given (e.g. linguist -a folderA folderB).

```py # folderA file.js # folderB .gitignore ignored notignored.txt ``` ```js > (await linguist(['folderA'])).files.results { 'folderA/file.js': 'JavaScript' } > (await linguist(['folderB'])).files.results { 'folderB/notignored.txt': 'Text' } > (await linguist(['folderA','folderB'])).files.results { 'folderA/.git/config': null, 'folderA/.git/description': null, // ... whole .git folder 'folderA/file.js': 'JavaScript', 'folderB/notignored.txt': 'Text' // NOT `ignored` - good, gitattributes works still ``` Example

Gitattributes is still read correctly however.

Nixinova commented 1 year ago

Looks like using e.g. linguist -a -i foo triggers this issue as well

Nixinova commented 1 year ago

Gitattributes seems not to be properly read.

Nixinova commented 1 year ago

Properly fixed now