Apply black reformatting to Python files only in regions changed since a given commit. For a practical usage example, see the blog post at https://dev.to/akaihola/improving-python-code-incrementally-3f7a
The -r/--revision argument has a number of features which are not intuitively easy to understand, including at least:
double dots (rev1..rev2)
triple dots (rev1...rev2)
omitting the dots (rev2)
omitting rev1 (..rev2 and ...rev2)
omitting rev2 (rev1.. and rev1...)
explicit worktree (e.g. rev1...:WORKTREE:)
implicit HEAD (e.g. rev1...HEAD)
pre-commit mode (:PRE-COMMIT:)
default value
ignored when run in a non-Git-repository directory
While the features are explained in the documentation, they would be much better communicated by using Git history diagrams along with the explanations – or perhaps common use cases and corresponding Git diagrams in a table.
Not sure if this particular Mermaid feature is supported in GitHub yet, though. It is. See comment below.
On the other hand, Mermaid doesn't probably render as easily on PyPI, or might turn out to generate less than satisfactory output. And we do have a plan to convert the README to proper Sphinx based documentation and publish it e.g. on Read the Docs (see #78), and for that there's sphinxcontrib-mermaid.
[ ] Once Git diagrams have been added, make sure Graylint documentation uses them too.
The
-r
/--revision
argument has a number of features which are not intuitively easy to understand, including at least:rev1..rev2
)rev1...rev2
)rev2
)..rev2
and...rev2
)rev1..
andrev1...
)rev1...:WORKTREE:
)HEAD
(e.g.rev1...HEAD
):PRE-COMMIT:
)While the features are explained in the documentation, they would be much better communicated by using Git history diagrams along with the explanations – or perhaps common use cases and corresponding Git diagrams in a table.
GitHub supports Mermaid, and Mermaid does have experimental support for Git graphs:
Not sure if this particular Mermaid feature is supported in GitHub yet, though.It is. See comment below.On the other hand, Mermaid doesn't probably render as easily on PyPI, or might turn out to generate less than satisfactory output. And we do have a plan to convert the README to proper Sphinx based documentation and publish it e.g. on Read the Docs (see #78), and for that there's sphinxcontrib-mermaid.