tempestphp / highlight

🎨 Fast, extensible, server-side code highlighting for web and terminal
https://tempest.stitcher.io/highlight/01-getting-started
MIT License
640 stars 38 forks source link

Add python support #121

Closed bogdancondorachi closed 5 months ago

bogdancondorachi commented 5 months ago

@brendt As the title suggests this PR adds Python language support :)

📋 TODO:

image

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 9206970052

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Languages/Python/Patterns/PyBooleanPattern.php 1 2 50.0%
src/Languages/Python/Patterns/PyClassNamePattern.php 1 2 50.0%
src/Languages/Python/Patterns/PyDecoratorPattern.php 1 2 50.0%
src/Languages/Python/Patterns/PyTripleSingleQuoteStringPattern.php 1 2 50.0%
<!-- Total: 47 51 92.16% -->
Totals Coverage Status
Change from base Build 9206715453: -0.1%
Covered Lines: 1550
Relevant Lines: 1626

💛 - Coveralls
bogdancondorachi commented 5 months ago

Ok @brendt, I will flag this as ready for review. I think it covers well most of the basic stuff to be considered usable.

I'll defiantly continue into more edge cases and additional patterns but for now I'll leave that for a later update.

brendt commented 5 months ago

Cool!

I'll defiantly continue into more edge cases and additional patterns but for now I'll leave that for a later update.

I agree, this can be finetuned later :) Are you on discord, by any chance? We have a server for Tempest related stuff, it would be nice if I could ping you there — I don't expect you to put in any work you don't want to, but I lack Python knowledge, so it'd be nice to bounce ideas off of someone if we need to further work on this: https://discord.gg/pPhpTGUMPQ

Also, shall I wait until #123 gets merged and you can update this PR accordingly?

brendt commented 5 months ago

FYI #123 has been merged :)

bogdancondorachi commented 5 months ago

@brendt Added NUMBER and BOOLEAN support. This can be merged now. I'll continue to improve on it when I find time but for now, it should cover enough to be usable.