linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add support for the Pkl configuration language

Open pixelcmtd opened this issue 4 months ago • 3 comments

Language name

To quote Pkl's homepage:

Pkl — pronounced Pickle — is a configuration-as-code language with rich validation and tooling. It can be used as a command line tool, software library, or build plugin. Pkl scales from small to large, simple to complex, ad-hoc to recurring configuration tasks.

We created Pkl because we believe that configuration is best expressed in a special-purpose configuration language; a blend between a static configuration format, and a general-purpose programming language.

Not to be confused with Python's “Pickle” serialisation format, stored on-disk using .pkl as a file extension.

URL of example repository

https://github.com/apple/pkl-k8s-examples

URL of syntax highlighting grammar

https://github.com/apple/tree-sitter-pkl

Editor extensions

Most popular file extensions

.pkl

Detected language

none

pixelcmtd avatar Feb 11 '24 01:02 pixelcmtd

~~The format you're referring to is already supported by Linguist as Pickle, assuming it's the same format documented by FileInfo.com. However, it lacks syntax highlighting (which may give the impression of the format not being supported on GitHub), so if you know of a TextMate-compatible grammar (i.e., not a Tree-Sitter grammar), we'd welcome a pull-request to add it, provided it's released under a permissive license. See CONTRIBUTING.md for more info on that.~~

EDIT: Never mind, I spoke too soon. I see that this actually refers to a different format entirely, one very similar to many other configuration-first data formats. Shouldn't be too hard to implement as a TextMate grammar, if one doesn't already exist. pkl-vscode doesn't qualify because the .tmLanguage.json file (the TextMate grammar proper) is generated at build-time and only distributed as part of a release asset (the VSIX bundle installed by VS Code; e.g., pkg-vscode-0.15.0.vsix. We could use Apple's Tree-Sitter grammar, but that's handled internally by GitHub staff, and not by Linguist…

Alhadis avatar Feb 11 '24 04:02 Alhadis

@Alhadis I took a stab at putting together a repo here https://github.com/nishtahir/language-pkl. Seems to work well in NovaLightshow . If you guys are ok with this, I can open a PR with it.

nishtahir avatar Feb 14 '24 19:02 nishtahir

New PR: https://github.com/github-linguist/linguist/pull/6730

bioball avatar Apr 12 '24 04:04 bioball