Tree-sitter: [Question] Ignoring generated files using Git

Created on 25 Nov 2018  路  3Comments  路  Source: tree-sitter/tree-sitter

My understanding is that files that can be generated from other code on the repo should not be checked into version control.

In particular, grammar.json and parser.c add a lot of noise to commits. Is it safe to ignore these?

Most helpful comment

Should that suggestion be included in the docs somewhere?

All 3 comments

If the parser only needs to be used from node.js, then it's ok to .gitignore those generated files, because they are published to npm. But if you want the parser to be able to be used from other languages (e.g. Rust, Haskell, Go), then including them in the repo is a huge simplification. Otherwise, applications wanting to use the parsers would need to regenerate them using tree-sitter-cli, which brings in another dependency and is slow for some grammars.

Should that suggestion be included in the docs somewhere?

@maxbrunsfeld That sounds like a good idea.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ubolonton picture ubolonton  路  3Comments

Astrantia picture Astrantia  路  5Comments

fwcd picture fwcd  路  6Comments

eugmes picture eugmes  路  4Comments

worudso picture worudso  路  4Comments