Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect dominant language type #6

Merged
merged 1 commit into from
Oct 4, 2018
Merged

Conversation

richardhozak
Copy link
Contributor

This detects language of source code repository at runtime.

Fixes #1

@o2sh o2sh merged commit e145e6d into o2sh:master Oct 4, 2018
@o2sh
Copy link
Owner

o2sh commented Oct 4, 2018

This seems a bit overkill in terms of the added number of dependencies, but it does the job...

thanks.

@richardhozak
Copy link
Contributor Author

Yeah, I might have a look sometimes, how tokei or loc do their analysis and maybe extract the relevant code, so it is not as big dependency. The reason I decided to go with this, it tokei had quite nice library api next to their command line utility, so I used that.

tokei::LanguageType::Haskell => Language::Haskell,
tokei::LanguageType::Ruby => Language::Ruby,
tokei::LanguageType::R => Language::R,
_ => unimplemented!(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaScript is a valid LanguageType.

cf https://docs.rs/tokei/6.0.2/tokei/enum.LanguageType.html

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, this is a work in progress. An issue was opened #2 for that purpose.

Feel free to contribute @Mouvedia

Thanks 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants