Metadata-Version: 2.1
Name: match-diff-lines
Version: 0.2.0
Maintainer-email: Florian Schulze <mail@florian-schulze.net>
License: Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
        of the Software, and to permit persons to whom the Software is furnished to do
        so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Bug Tracker, https://github.com/fschulze/match-diff-lines/issues
Project-URL: Changelog, https://github.com/fschulze/match-diff-lines/blob/main/CHANGELOG.rst
Project-URL: Homepage, https://github.com/fschulze/match-diff-lines
Project-URL: Source Code, https://github.com/fschulze/match-diff-lines
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE

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]
