New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tree-sitter-cfengine

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sitter-cfengine

CFEngine grammar for tree-sitter

  • 1.0.8
  • PyPI
  • Socket score

Maintainers
1

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 .

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc