From 5ec275c05cf34eba3df4e163bb10e721f7587a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Mon, 20 Nov 2023 10:43:23 +0100 Subject: [PATCH] Fix "Unexpected indentation error" in docs build And some minor coding style fixes regarding tabs and trailing whitespaces. --- pygit2/enums.py | 1 - pygit2/filter.py | 24 ++++++++++++++---------- pygit2/remote.py | 4 ++-- pygit2/repository.py | 2 +- src/mailmap.c | 2 +- src/refdb_backend.c | 6 ++---- test/test_submodule.py | 1 - 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pygit2/enums.py b/pygit2/enums.py index 57f6d9797..a4e63a418 100644 --- a/pygit2/enums.py +++ b/pygit2/enums.py @@ -62,4 +62,3 @@ class SubmoduleStatus(IntFlag): WD_UNTRACKED = _pygit2.GIT_SUBMODULE_STATUS_WD_UNTRACKED "submodule workdir contains untracked files (flag available if ignore is NONE)" - diff --git a/pygit2/filter.py b/pygit2/filter.py index 3a55987fd..d90a6664e 100644 --- a/pygit2/filter.py +++ b/pygit2/filter.py @@ -67,11 +67,12 @@ def check(self, src: FilterSource, attr_values: List[Optional[str]]): If `Passthrough` is raised, the filter will not be applied. Parameters: - src: The source of the filtered blob. - attr_values: The values of each attribute for the blob being - filtered. `attr_values` will be a sorted list containing - attributes in the order they were defined in - ``cls.attributes``. + + src: The source of the filtered blob. + + attr_values: The values of each attribute for the blob being filtered. + `attr_values` will be a sorted list containing attributes in the + order they were defined in ``cls.attributes``. """ def write( @@ -86,11 +87,14 @@ def write( `write()` may be called multiple times per stream. Parameters: - data: Input data. - src: The source of the filtered blob. - write_next: The ``write()`` method of the next filter in the chain. - Filtered output data should be written to `write_next` whenever - it is available. + + data: Input data. + + src: The source of the filtered blob. + + write_next: The ``write()`` method of the next filter in the chain. + Filtered output data should be written to `write_next` whenever it is + available. """ write_next(data) diff --git a/pygit2/remote.py b/pygit2/remote.py index 55df06719..3734c9c28 100644 --- a/pygit2/remote.py +++ b/pygit2/remote.py @@ -130,10 +130,10 @@ def fetch(self, refspecs=None, message=None, callbacks=None, prune=C.GIT_FETCH_P * `None` (the default) to disable proxy usage * `True` to enable automatic proxy detection * an url to a proxy (`http://proxy.example.org:3128/`) - + depth : int Number of commits from the tip of each remote branch history to fetch. - + If non-zero, the number of commits from the tip of each remote branch history to fetch. If zero, all history is fetched. The default is 0 (all history is fetched). diff --git a/pygit2/repository.py b/pygit2/repository.py index 553a3eb61..c58666a67 100644 --- a/pygit2/repository.py +++ b/pygit2/repository.py @@ -665,7 +665,7 @@ def diff(self, a=None, b=None, cached=False, flags=GIT_DIFF_NORMAL, def state(self) -> int: """Determines the state of a git repository - ie, whether an operation (merge, cherry-pick, etc) is in progress. - + Returns a GIT_REPOSITORY_STATE_* constant. """ return C.git_repository_state(self._repo) diff --git a/src/mailmap.c b/src/mailmap.c index 84b72ac0e..981bbe90b 100644 --- a/src/mailmap.c +++ b/src/mailmap.c @@ -66,7 +66,7 @@ PyDoc_STRVAR(Mailmap_from_repository__doc__, "Mailmaps are loaded in the following order:\n" " 1. '.mailmap' in the root of the repository's working directory, if present.\n" " 2. The blob object identified by the 'mailmap.blob' config entry, if set.\n" - " [NOTE: 'mailmap.blob' defaults to 'HEAD:.mailmap' in bare repositories]\n" + " [NOTE: 'mailmap.blob' defaults to 'HEAD:.mailmap' in bare repositories]\n" " 3. The path in the 'mailmap.file' config entry, if set."); PyObject * Mailmap_from_repository(Mailmap *dummy, PyObject *args) diff --git a/src/refdb_backend.c b/src/refdb_backend.c index b858acc94..7e8571f5e 100644 --- a/src/refdb_backend.c +++ b/src/refdb_backend.c @@ -85,8 +85,7 @@ iterator_get_next(struct pygit2_refdb_iterator *iter) } static int -pygit2_refdb_iterator_next( - git_reference **out, git_reference_iterator *_iter) +pygit2_refdb_iterator_next(git_reference **out, git_reference_iterator *_iter) { struct pygit2_refdb_iterator *iter = (struct pygit2_refdb_iterator *)_iter; Reference *ref = iterator_get_next(iter); @@ -104,8 +103,7 @@ pygit2_refdb_iterator_next( } static int -pygit2_refdb_iterator_next_name(const char **ref_name, - git_reference_iterator *_iter) +pygit2_refdb_iterator_next_name(const char **ref_name, git_reference_iterator *_iter) { struct pygit2_refdb_iterator *iter = (struct pygit2_refdb_iterator *)_iter; Reference *ref = iterator_get_next(iter); diff --git a/test/test_submodule.py b/test/test_submodule.py index e7bc2fd14..cb936f573 100644 --- a/test/test_submodule.py +++ b/test/test_submodule.py @@ -223,4 +223,3 @@ def test_submodule_reload(repo): # Tell it to refresh its cache sm.reload() assert sm.url == "https://github.com/libgit2/pygit2" -