-
Notifications
You must be signed in to change notification settings - Fork 464
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
simplify language configuration #896
Conversation
if args.language == Language.GO.value: | ||
lang_id = Language.GO | ||
elif args.language == Language.RUST.value: | ||
lang_id = Language.RUST | ||
elif args.language == Language.DOTNET.value: | ||
lang_id = Language.DOTNET | ||
elif args.language == "none": | ||
lang_id = Language.UNKNOWN | ||
else: | ||
lang_id = identify_language(sample, static_strings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if args.language == Language.GO.value: | |
lang_id = Language.GO | |
elif args.language == Language.RUST.value: | |
lang_id = Language.RUST | |
elif args.language == Language.DOTNET.value: | |
lang_id = Language.DOTNET | |
elif args.language == "none": | |
lang_id = Language.UNKNOWN | |
else: | |
lang_id = identify_language(sample, static_strings) | |
lang_id_mapping = { | |
Language.GO.value: Language.GO, | |
Language.RUST.value: Language.RUST, | |
Language.DOTNET.value: Language.DOTNET, | |
"none": Language.UNKNOWN, | |
} | |
lang_id = lang_id_mapping.get(args.language, identify_language(sample, static_strings)) |
I suggest adopting this mapping approach for language identification. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's neat, please submit a PR as this is already merged now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay! 😄
No description provided.