Skip to main content

No project description provided

Project description

Ondivi (Only diff violations)

wemake-python-styleguide PyPI version CI status Lines of code Hits-of-Code

This is a simple Python script designed to filter coding violations (likely identified by a static analyzer) for only the lines that have been changed in a Git repository.

Prerequisites:

  • Python 3.9 or higher
  • Git

Installation

pip install ondivi

Usage

Ensure you are in the root directory of your Git repository.

Run the script:

flake8 script.py | ondivi
ondivi --help
Usage: ondivi [OPTIONS]

  Ondivi (Only diff violations).

  Python script filtering coding violations, identified by static analysis,
  only for changed lines in a Git repo. Usage example:

  flake8 script.py | ondivi

Options:
  --baseline=BASELINE   Commit or branch which will contain legacy code.
                        Program filter out violations on baseline (default:
                        "master")
  --format=VIOLATION_FORMAT
                        Template for parsing linter messages. The template
                        should include the following named parts:  {filename}
                        The name of the file with the error/warning {line_num}
                        The line number with the error/warning (integer)
                        Example usage: --format
                        "{filename}:{line_num:d}{other}"  In this example, the
                        linter message "src/app_types/listable.py:23:1: UP035
                        Import from `collections.abc` instead: `Sequence`"
                        will be recognized and parsed into the following
                        components:   - filename: "src/app_types/listable.py"
                        - line_num: 23   - other: :1: UP035 Import from
                        `collections.abc` instead: `Sequence`"  Ensure that
                        the template matches the format of the messages
                        generated by your linter.  (default:
                        "{filename}:{line_num:d}{other}")
  --only-violations     Show only violations
  --help                Show this message and exit.

How it Works

The script parses the Git diff output to identify the changed lines in each file.

It then filters the given coding violations to include only those violations that correspond to the changed lines.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ondivi-0.5.0.tar.gz (13.8 kB view hashes)

Uploaded Source

Built Distribution

ondivi-0.5.0-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page