Skip to content

Add Julia language recognition support. Fixes #4596#49

Open
HasTheDev wants to merge 1 commit intoaboutcode-org:mainfrom
HasTheDev:main
Open

Add Julia language recognition support. Fixes #4596#49
HasTheDev wants to merge 1 commit intoaboutcode-org:mainfrom
HasTheDev:main

Conversation

@HasTheDev
Copy link
Copy Markdown

This PR adds recognition for the Julia language by updating the Type class logic and adding a dedicated test case.
This addresses the identification gap reported in aboutcode-org/scancode-toolkit#4596.

Signed-off-by: HasTheDev <hassanazam2021@gmail.com>
@HasTheDev
Copy link
Copy Markdown
Author

I've updated the PR with the Julia language support and verified the indentation and logic.

Please note that the current failures in the Windows Azure Pipelines (test_gz_entropy in tests/test_entropy.py) appear to be pre-existing flaky tests unrelated to my changes, as I did not modify the entropy logic.

Everything else is passing on Ubuntu and macOS. Ready for review!

Copy link
Copy Markdown
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

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

@HasTheDev this looks good, and is mergable right now.
But since you've looked into this part already, it would be great to extend the functionality here similarly for other major languages which can be detected by extensions.

Can you also rebase from latest main, I've fixed all the tests there.

return ""

@property
def is_julia_source(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add this to https://github.com/HasTheDev/typecode/blob/e0a7a01c80478b3dced76bc65fa7b33dcfa62a2c/src/typecode/contenttype.py#L184C5-L184C23?

Can you also add a test which goes through all the attributes and checks if all of them exists?


elif self.is_java_source is True or self.is_c_source is True:
# Recognize "known-by-extension" source types
elif self.is_java_source or self.is_c_source or self.is_julia_source:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is too few source types IMHO, we should extend to major languages.

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.

2 participants