sfer.nvim is a lightweight Neovim plugin designed to visualize SARIF (Static Analysis Results Interchange Format) files directly within the editor. Currently optimized for CodeQL SARIF outputs, it provides an intuitive sidebar interface to navigate and inspect static analysis findings.
Using [lazy.nvim](https://github.com/folke/lazy.nvim):
{
'fguisso/sfer.nvim',
config = function()
require('sfer').setup()
end
}- Sidebar Navigation: Explore SARIF reports in a structured sidebar.
- Interactive Exploration: Press
lto open files at specific findings. - Visual Highlights: Highlights affected code regions.
- Lazy Loading: Optimized for performance with lazy loading capabilities.
- Minimal Dependencies: Designed to work seamlessly with LazyVim and other setups.
Once sfer.nvim is installed and configured, it works automatically:
-
โ When you open a Neovim session in a folder that contains a
.sariffile (e.g.results.sarif), the plugin automatically detects and loads it. -
๐งญ A sidebar will appear on the right showing:
- Grouped rules
- Findings per file
- Locations per finding
-
l:- Expand/collapse items in the sidebar
- If you're on a specific location, it will open the related file and highlight the issue
-
q: Close the sidebar
Customize the plugin by passing options to the `setup` function:
require('sfer').setup({
sidebar = {
width = 45, -- Width of the sidebar
border = 'single' -- Border style: 'single', 'double', 'rounded', etc.
},
indent = {
rule = 0, -- Indentation for rule lines
location = 2, -- Indentation for location lines
alert = 4 -- Indentation for alert lines
}
})We're actively developing sfer.nvim. Here are the next planned features:
- ๐จ Add custom highlight groups for better visual distinction of results and locations
- ๐งฑ Improve Nerd Font icons for each tree level (rule, result, location)
- ๐ Indent guide lines similar to
nvim-tree, showing vertical lines along hierarchy - ๐ Hover preview: show full file path of a location in the statusline or a floating window
- ๐ Highlight current result block with stronger styles (bold, underline, or background)
- ๐ SARIF Explorer mode: allow filtering by rule, severity, or file (for large reports)
This project was inspired by the excellent work from:
Thanks for paving the way in SARIF tooling and Neovim integration.
Pull requests and ideas are welcome! Feel free to open issues or create discussions.
Hack the planet!