Sylver is a language-agnostic tool for source code exploration and analysis.
Using the SYLQ query language REPL, you can perform syntax-aware search on your codebase to find style issues and potential bugs.
Interesting queries can be packaged into a ruleset to be executed in a linter-like fashion.
There is no first-class support for any specific language: to use sylver, you need a language spec for your language.
Install the CLI
- Install script
- Direct download
Run queries in the REPL
- Golang
- JSON
To start the sylver REPL, invoke the following command at the root of your Golang project:
You can exit the REPL by entering the following command at the prompt :quit
The parse tree for a given file can be displayed by using the following command
:print_ast FILE
To execute a query, type the query followed by a semicolon. Here are some examples:
- Q1
- Q2
- Q3
- Q4
To start the sylver REPL, invoke the following command in a directory containing JSON files:
You can exit the REPL by entering the following command at the prompt :quit
The parse tree for a given file can be displayed by using the following command
:print_ast FILE
To execute a query, type the query followed by a semicolon. Here are some examples:
- Q1
- Q2
See the documentation to learn more about SYLQ queries.
Create and evaluate SYLQ-based rulesets
- Go
This YAML document describes a SYLQ-based ruleset. Assuming it is stored at the root of your project in a file called style_ruleset.yaml, your can run it by invoking the following command: