Skip to content

Add Skript and Skip languages with .sk extension disambiguation - #8054

Open
RohanDaCoder wants to merge 6 commits into
github-linguist:mainfrom
RohanDaCoder:add-skript-language
Open

RohanDaCoder wants to merge 6 commits into
github-linguist:mainfrom
RohanDaCoder:add-skript-language

Conversation

@RohanDaCoder

@RohanDaCoder RohanDaCoder commented Jul 4, 2026 •

Copy link
Copy Markdown

Description

Adds Skript and Skip to languages.yml — both use the .sk extension — plus a disambiguation heuristic in heuristics.yml.

Skript is a scripting language for Minecraft servers (a Paper/Bukkit plugin) that lets server owners modify their servers without writing Java. Skip is a general-purpose language with reactive caching; its compiler and standard library are written in .sk files.

.sk is not currently claimed by any other language in languages.yml, so .sk files fall through unclassified today. This addresses the requirements in #6559 (a second .sk language plus a heuristic), supersedes #7659, and closes #6857. Credit to @Camden-png for the original grammar and colour work.

Heuristic

- extensions: ['.sk']
  rules:
  - language: Skript
    pattern: '\{[_a-zA-Z]\w*(?:::[\w*]+)*\}'
  - language: Skip
    pattern: '^(?:module|fun|native|val|var|let)\s'

Skript is matched first on its curly-brace variable syntax ({var}, {list::key}), then Skip on line-leading declaration keywords. Both rules are specific, so a .sk file that matches neither is not forced into one language. As .sk is a very generic extension that is also widely used by many other formats, it is additionally listed in generic.yml, so a .sk file is only identified as Skript or Skip when the heuristic matches and everything else is left unclassified.

I checked every sample: each matches its own rule and does not match the other language's rule. script/check-regex-compatibility passes locally with Ruby, Go, and Rust, and the full test/test_heuristics.rb passes on an LF checkout (179 runs, 3079 assertions, 0 failures). GitHub Actions is currently showing action_required for this fork, so CI needs approval before it can run.

#6559 suggested Skip or Skew; this adds Skip. Skew can follow separately.

Checklist:

Adds support for the Skript language (Minecraft server scripting) and
Skip language (general-purpose reactive programming) to Linguist.

- Skript: Minecraft server scripting language with English-like syntax
  Grammar: SkriptLang/skript-grammar (MIT license)
  Samples: chest menus, text formatting, variables

- Skip: A general-purpose programming language tracking side effects
  Samples: skipComment.sk from the Skip compiler source

- Heuristic: Skript detected by curly-brace variable syntax ({var}, {list::key});
  Skip detected by module/fun/val declarations

Closes github-linguist#6857
@RohanDaCoder
RohanDaCoder requested a review from a team as a code owner July 4, 2026 05:47
@RohanDaCoder RohanDaCoder mentioned this pull request Jul 4, 2026
5 tasks done
@Camden-png

Copy link
Copy Markdown

Wow! Thank you, Rohan!

@lildude lildude added the Invalid CONTRIBUTING.md file has not been followed or PR template not used. label Jul 21, 2026
@lildude

lildude commented Aug 10, 2026

Copy link
Copy Markdown
Member

This PR will not be reviewed until you have correctly filled in our PR template. It's there for a reason and needs to be completed accordingly.

@RohanDaCoder
RohanDaCoder marked this pull request as draft October 23, 2026 03:49
- Replace the bundled Skript example scripts with MIT-licensed real-world scripts
- Add Skip prelude samples so both .sk languages have at least two samples
- Add test_sk_by_heuristics covering both languages
- Move the .sk heuristic block into alphabetical order
@RohanDaCoder
RohanDaCoder marked this pull request as ready for review October 23, 2026 04:19
@RohanDaCoder

Copy link
Copy Markdown
Author

@lildude I've updated this PR to fully comply with the CONTRIBUTING.md template and addressed the requirements raised in #6559.

What changed since the initial review:

  • Samples: Replaced the bundled Skript examples (which were essentially tutorials) with custom, MIT-licensed Skript scripts to avoid copyright ambiguity. Added real-world MIT-licensed Skip samples (from the official compiler source) so both languages meet the ≥2 sample requirement for shared extensions.
  • Heuristics: Added test_sk_by_heuristics and verified script/check-regex-compatibility passes cleanly.
  • Template: Filled out the checklist with exact search metrics, proper sample licensing, and language IDs generated via script/update-ids.

The Invalid label is still attached from my initial template mistake. Could you remove it so this can enter the normal review queue?

(Note: CI is currently action_required pending workflow approval for new contributors).

Thanks for the guidance and for your time reviewing!


@lildude lildude left a comment

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.

samples/Skip/Array.sk and samples/Skip/String.sk are too big - if they're suppressed in the diff, they're too big for our needs. Please replace these with representative samples.

This also appears to be a very generic and commonly used extension that is used by many other languages. As such, please also add this extension to the generic.yml file and update tests etc. See one of the PRs used to add other extensions to that file to see what else needs to be done.

@lildude lildude removed the Invalid CONTRIBUTING.md file has not been followed or PR template not used. label Nov 26, 2026
Address review feedback from lildude:

- Replace the 826-line Array.sk and 532-line String.sk Skip samples with
  smaller representative samples (Bool.sk, Math.sk) from the same upstream
  source so the diff renders without collapsing.
- Add .sk to generic.yml as the extension is very widely used by many
  other formats, move the Skript and Skip samples into
  test/fixtures/Generic/sk/, and add nil fixtures for .sk files matching
  neither heuristic, following the .sol and .sd pattern.
- Update test_sk_by_heuristics to cover the Generic fixtures and the nil
  case.
- Remove a stray trailing blank line in .gitmodules so
  script/sort-submodules passes.
@RohanDaCoder

Copy link
Copy Markdown
Author

@lildude Thanks for the review! Pushed 7c33855 with both requested changes:

  • Samples: Replaced the oversized Array.sk (826 lines) and String.sk (532 lines) Skip samples with Bool.sk and Math.sk — smaller representative files from the same upstream source (skiplang/skip, MIT) — and kept skipComment.sk. The samples now live under test/fixtures/Generic/sk/{Skript,Skip}/, as required for generic extensions, so the diff renders without collapsing.
  • Generic extension: Added .sk to generic.yml and updated test_sk_by_heuristics to use the Generic/sk fixtures with a nil case for files matching neither rule (following the .sol/.sd pattern). Also added nil fixtures and removed a stray trailing blank line in .gitmodules that would fail script/sort-submodules.

@RohanDaCoder
RohanDaCoder requested a review from lildude November 27, 2026 04:28
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.

Add Skript

3 participants