Skip to content

Commit

Permalink
Fixes #3 by filtering files using new .IsGenerated()
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Bezzubov <[email protected]>
  • Loading branch information
bzz committed Jun 10, 2020
1 parent 2210db2 commit 918a049
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func main() {
}

if enry.IsVendor(relativePath) || enry.IsDotFile(relativePath) ||
enry.IsDocumentation(relativePath) || enry.IsConfiguration(relativePath) {
// TODO(bzz): skip enry.IsGeneratedPath() after https://github.com/src-d/enry/issues/213
enry.IsDocumentation(relativePath) || enry.IsConfiguration(relativePath) ||
enry.IsGenerated(relativePath, nil) {
if f.IsDir() {
return filepath.SkipDir
}
Expand All @@ -106,7 +106,10 @@ func main() {
log.Println(err)
return nil
}
// TODO(bzz): skip enry.IsGeneratedContent() as well, after https://github.com/src-d/enry/issues/213

if enry.IsGenerated(relativePath, content) {
return nil
}

language := enry.GetLanguage(filepath.Base(path), content)
if language == enry.OtherLanguage {
Expand Down

0 comments on commit 918a049

Please sign in to comment.