Add Julia language recognition support. Fixes #4596#49
Add Julia language recognition support. Fixes #4596#49HasTheDev wants to merge 3 commits intoaboutcode-org:mainfrom
Conversation
179a6cd to
e0a7a01
Compare
|
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! |
There was a problem hiding this comment.
@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): |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
This is too few source types IMHO, we should extend to major languages.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Signed-off-by: HasTheDev <hassanazam2021@gmail.com>
…c attribute tests
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.