Skip to content

Add Julia language recognition support. Fixes #4596#49

Open
HasTheDev wants to merge 3 commits intoaboutcode-org:mainfrom
HasTheDev:main
Open

Add Julia language recognition support. Fixes #4596#49
HasTheDev wants to merge 3 commits 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.

@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?

Comment thread src/typecode/contenttype.py Outdated

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the review, Ayan! I'll rebase from main to grab those fixed tests. I will also start looking into extending this to other major languages and adding the attribute tests you suggested. I'll push an update as soon as I make some progress.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi Ayan,

The updates are pushed and the new dynamic attribute test passes cleanly!

The remaining CI failures in test_types.py are expected because the repository's saved test fixtures are now outdated. They just need to be regenerated to include the new language keys (e.g., is_python_source).
I tried running regen=True locally to update them for you, but libmagic segfaults during pytest collection on Windows. Could you trigger the fixture regeneration on your end?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi Ayan, just a gentle bump on this! Let me know if you need anything else from my side to get those test fixtures regenerated.

HasTheDev and others added 2 commits April 11, 2026 06:11
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