From 5e723d53077210bc51272320b76577b44730c55e Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 30 Oct 2025 19:19:40 +0100 Subject: more documentation tweaks --- .editorconfig | 2 +- doc/conf.py | 5 +---- doc/index.rst | 20 ++++++++++++++++++++ patchtree/diff.py | 5 ++++- pyproject.toml | 2 +- readme.rst | 2 ++ 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.editorconfig b/.editorconfig index c4d6fb1..44f19e2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ root = true [*] end_of_line = lf insert_final_newline = true -max_line_length = 110 +max_line_length = 95 [*.py] indent_size = 4 diff --git a/doc/conf.py b/doc/conf.py index 0dc01c8..477a00d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -12,10 +12,7 @@ import patchtree project = "patchtree" release = "???" -extensions = [ - "sphinx.ext.autodoc", - "sphinx_automodapi.automodapi", -] +extensions = ["sphinx.ext.autodoc"] templates_path = [] exclude_patterns = [] html_theme = "sphinx_rtd_theme" diff --git a/doc/index.rst b/doc/index.rst index 5b13ded..ab8649a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,4 +1,24 @@ +.. raw:: html + + + .. include:: ../readme.rst + :end-line: 18 ############# Documentation diff --git a/patchtree/diff.py b/patchtree/diff.py index 5a76487..4d4a998 100644 --- a/patchtree/diff.py +++ b/patchtree/diff.py @@ -17,6 +17,9 @@ class File: """The file's mode as returned by stat(3)'s ``stat.st_mode``.""" def is_binary(self) -> bool: + """ + :returns: A boolean representing whether this file's content is binary. + """ return isinstance(self.content, bytes) def lines(self) -> list[str]: @@ -29,7 +32,7 @@ class File: .. note:: - This function only works for text files. Use :any:`File.is_binary` to check this safely. + This function only works for text files. Use :any:`is_binary` to check this safely. """ assert not isinstance(self.content, bytes) return (self.content or "").splitlines() diff --git a/pyproject.toml b/pyproject.toml index 2835ae7..713b293 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,4 +24,4 @@ Homepage = "https://bitbucket.global.renesas.com/users/loek.le-blansch.pv_renesa patchtree = "patchtree.cli:main" [tool.black] -line-length = 110 +line-length = 95 diff --git a/readme.rst b/readme.rst index a40c07b..8e4b901 100644 --- a/readme.rst +++ b/readme.rst @@ -16,3 +16,5 @@ Patchtree is a tool for generating clean patches for external source trees. It allows both patch sources to be maintained separately from the sources they apply to, and templating or scripting of the patches themselves in order to adjust to variations in the external source tree. This makes it a useful for automating the process of backporting bugfixes or adding functionality to existing software releases. + +See ``_ for user, developer and API documentation. -- cgit v1.2.3