Ondivi is a Python script that filters static analysis coding violations to show only those occurring on changed lines in a Git repository.
Ondivi (Only diff violations) is a Python script filtering coding violations, identified by static analysis, only for changed lines in a Git repo.
Ondivi is used by developers and DevSecOps teams to focus on new or modified code by filtering out legacy static analysis violations, improving code review efficiency and reducing noise from existing issues. It integrates with various linters to highlight only the violations introduced in recent changes within a Git repo.
Ondivi requires Python 3.9+ and Git installed. It is designed to work with the text output of linters and does not support tools relying on internal linter APIs like flakeheaven or flakehell. Users should ensure the format template matches their linter's output for accurate parsing. Running the script from the root of the Git repository is recommended for correct diff detection.
Ensure Python 3.9 or higher is installed
Ensure Git is installed and available in the system PATH
Run the command: pip install ondivi
flake8 script.py | ondivi
Filters Flake8 violations to show only those on changed lines in the current Git repo
ruff check file.py --output-format=concise | ondivi
Filters Ruff linter output to only violations on changed lines
flake8 script.py > violations.txt ondivi --fromfile=violations.txt
Filters violations read from a file instead of standard input
ondivi --baseline=develop
Sets the baseline branch or commit to 'develop' to filter out legacy violations
ondivi --format "{filename}:{line_num:d}{other}"
Customizes the parsing template to match the linter message format