Tree sitter grammar for CFEngine policy language
This tree-sitter grammar parses CFEngine policy language and turns it into an abstract syntax tree. It is used to provide syntax highlighting in the Zed editor, via this extension:
https://github.com/olehermanse/zed-cfengine
The grammar currently supports all major features of the language, including:
- Bundle blocks
- Body blocks
- Promise type definition blocks
- Promise types, class guards, promises, stakeholders (promisees)
- Macros
- Function calls
- Lists, strings, expansions (with
$()and@())
Todos
- Using the grammar for linting / syntax checking (language server)
- Highlighting inside strings and comments
- Recognizing when there is JSON inside policy
- Class guards which are quoted strings
- Using the grammar for code indentation
- Using the grammar for extensions to other editors
Before contributing for the first time, it's recommended to go through the tree-sitter tutorial for getting familiar with how everything works:
https://tree-sitter.github.io/tree-sitter/creating-parsers
Inspired by Lars Erik Wik's initial implementation available here:
https://github.com/larsewi/tree-sitter-cfengine
Run containerized tests locally:
docker build --tag tree-sitter-cfengine .
Making changes
After making changes to grammar.js, run the the commands below to generate, build, and test:
tree-sitter generate && tree-sitter build && tree-sitter test
In tree-sitter projects, it is normal to commit the files generated / edited by the tree-sitter tooling.
Once it is working and tests are passing, commit the changes (including src/ folder with generated files).
Updating dependencies
npm update --save && cargo update && uv sync --upgrade
Creating a new release
Creating a release in GitHub will not work. To create a new release, you need to make a commit and tag locally, and push it. First ensure you have a clean git repo without any uncommitted changes. Then, run the releas script:
bash release.sh 1.2.3
GitHub Actions will start when a tag is pushed, and the action will create the "Release" in GitHub, as well as pypi, npm, and crates.io:
Metadata
Release files for tree-sitter-cfengine 1.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tree_sitter_cfengine-1.1.12.tar.gz | 16.8 kB | Without provenance | Details for tree_sitter_cfengine-1.1.12.tar.gz |
Built distributions (wheels)
Total release size: 174.4 kB
Release files / tree_sitter_cfengine-1.1.12.tar.gz
| Download URL | tree_sitter_cfengine-1.1.12.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98a0524acb41988a18dce91f915c61248e979dfe227ee86e45bf81f00816dde2
|
|
BLAKE2b-256 checksum How to use checksums |
b6826c587bacd4983ceb767afb8f38c99a281e09f1ad0bc8128ecf3d0000535d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-win_arm64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 14.8 kB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
1d883df6aaae4882080c247cbc0f2b756f94bf731ca9886d1573931561251dc8
|
|
BLAKE2b-256 checksum How to use checksums |
e0baa2cff11544e136d78a5f2a62edac9ed7fc3e77a51d8c712a61882b606c1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-win_amd64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 16.0 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f6fc2b06fb9484c6775e21171d162e21dec1645ad3e9be6a389294e108b75f4b
|
|
BLAKE2b-256 checksum How to use checksums |
2bf5afa98aa454a0cf0ea9215c0f853fdbbb332ee627582b1f979747ed14b850
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 23.9 kB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1bf058a38376ab0673ec13faa8cbd9e83e062b7cab633cddd4a2ebca59f2598e
|
|
BLAKE2b-256 checksum How to use checksums |
6e044ca7634e95bd165ed4390595d38bd8ca0fd773b62fdc81fff0133fab39aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 25.6 kB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
3d0f1552d3ae3ac0926b214a2f7d3d3ab1b7cbc80d8c2e0188cd088d50de1677
|
|
BLAKE2b-256 checksum How to use checksums |
7eb2129a14ea4df6dd6d2ca916dd374c35456cc6fbd93356cdc9d3ccd707810b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 26.5 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7ee214229b47943d040e1f417c1e90fba13b0cde42447dab9ea8e5b8fa835e6d
|
|
BLAKE2b-256 checksum How to use checksums |
fef63a333a3642fc361245ae759ce5cd47ad2b1794ae8f3b5495447b6c6abbc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 24.1 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6c63ddb5ca3e493a3ebc2e4ff6a3d0f881ec4455ca465bee274ebf2df409e2d1
|
|
BLAKE2b-256 checksum How to use checksums |
6bb24dd66177c89863e88806fbd1d3fd90f049c415e2ff0d514290a14e21b7f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 13.6 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7d8e251ab24f5fec347d32c4aa469f76354060625d2b1d977daa525a60f22d0d
|
|
BLAKE2b-256 checksum How to use checksums |
7134ee8e71c7b055a6c72d0426193407a95fa266f76b72b44ef74e2e87b672be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tree_sitter_cfengine-1.1.12-cp39-abi3-macosx_10_9_x86_64.whl
| Download URL | tree_sitter_cfengine-1.1.12-cp39-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 13.0 kB |
| Tags | CPython 3.9 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
439a686b5c42059b215460d9f00b403a18cf8885230616db6245c5316a17a291
|
|
BLAKE2b-256 checksum How to use checksums |
d4cfebd9d6c01251c7072ddb2c5ddedc012984cd058bdcdd5c7d523ab0463a9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for tree-sitter-cfengine 1.1.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.