Skip to content

A linguist-inspired language classifier with multiple file source handlers

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

spenserblack/gengo

Repository files navigation

gengo (言語)

library binary CI codecov

A linguist-inspired language classifier with multiple file source handlers

Comparison

Feature/Behavior linguist tokei gengo
Analyze Git Revision Yes No Yes
Analyze Directory No Yes Yes
Requires Git Repository Yes No No
Detect Language by Extension Yes Yes Yes
Detect Language by Filename Yes Yes Yes
Detect by Filepath Pattern No No Yes
Detect Language with Heuristics Yes No Yes
Detect Language with Classifier Yes No Not Yet ;)

Installation

View the installation documentation.

Usage

This tool has multiple file sources. Each file source can have unique usage to take advantage of its strengths and work around its weaknesses.

Directory File Source

This is a very generic file source that tries not to make many assumptions about your environment and workspace.

Ignoring Files

You can utilize a .gitignore file and/or an .ignore file to prevent files from being scanned. See the ignore for more details.

Git File Source

The git file source is highly opinionated -- it tries to act like a git utility, and uses git tools. Its goal is to behave similarly to linguist.

Overrides

Like linguist, you can override behavior using a .gitattributes file. Basically, just replace linguist-FOO with gengo-FOO. Unlike linguist, gengo-detectable will always make a file be included in statistics (linguist will still exclude them if they're generated or vendored).

# .gitattributes

# boolean attributes:

# These can be *negated* by prefixing with `-` (`-gengo-documentation`).
# Mark a file as documentation
*.html gengo-documentation
# Mark a file as generated
my-built-files/* gengo-generated
# Mark a file as vendored
deps/* gengo-vendored

# string attributes:
# Override the detected language for a file
# Use the Language enum's variant name (see docs.rs for more details)
templates/*.js gengo-language=PlainText

You will need to commit your .gitattributes file for it to take effect.

About

A linguist-inspired language classifier with multiple file source handlers

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages