Skip to main content

No project description provided

Project description

match-diff-lines

Match a diff to a list of lines from linters and other tools like flake8 or ruff.

Installation

Best to install into a virtual environment with a Python installer like pip or similar.

Usage

Invoke python -m match_diff_lines diff_file tool_output. The diff_file is a file containing the unified diff output you want to check against. The tool_output contains the output of your linter/tool which contains lines in the form of filename:line_num for example:

match_diff_lines.py:59:39: E271 multiple spaces after keyword

If any lines are contained in the diff, then they are printed and exit code 1 is returned.

With bash or zsh you can use temporary named pipes like this:

% python -m match_diff_lines <(git diff HEAD^) <(ruff check)

Changelog

0.2.0 - 2024-07-21

  • Add match-diff-lines script on installation. [fschulze]

0.1.0 - 2024-07-21

  • Initial release. [fschulze]

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

match_diff_lines-0.2.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

match_diff_lines-0.2.0-py3-none-any.whl (4.9 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