Skip to content

fguisso/sfer.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

sfer.nvim

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.

๐Ÿ“ฆ Installation

Using [lazy.nvim](https://github.com/folke/lazy.nvim):
{
  'fguisso/sfer.nvim',
  config = function()
    require('sfer').setup()
  end
}

โœจ Features

  • Sidebar Navigation: Explore SARIF reports in a structured sidebar.
  • Interactive Exploration: Press l to 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.

๐Ÿš€ Usage

Once sfer.nvim is installed and configured, it works automatically:

  • โœ… When you open a Neovim session in a folder that contains a .sarif file (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

๐Ÿ•น๏ธ Controls

  • 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

โš™๏ธ Configuration

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
  }
})

๐Ÿ”ฎ TODO

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)

๐Ÿ™ Acknowledgements

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!

About

A simple neovim plugin to visualize SARIF files. Actualy tested in CodeQL SARIF files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages