Forráskód Böngészése

Merge pull request #1040 from jelmer/apidoc-format

Fix docstring formatting
Jelmer Vernooij 2 éve
szülő
commit
f3c942f8bd
3 módosított fájl, 30 hozzáadás és 4 törlés
  1. 23 0
      .github/workflows/docs.yml
  2. 1 1
      Makefile
  3. 6 3
      dulwich/porcelain.py

+ 23 - 0
.github/workflows/docs.yml

@@ -0,0 +1,23 @@
+
+name: API Docs
+
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron: "0 6 * * *" # Daily 6AM UTC build
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python
+        uses: actions/setup-python@v2
+      - name: Install pydoctor
+        run: |
+          sudo apt-get update && sudo apt -y install -y pydoctor python3-pip
+          pip3 install pydoctor
+      - name: Generate docs
+        run: make apidocs

+ 1 - 1
Makefile

@@ -74,4 +74,4 @@ coverage-html: coverage
 .PHONY: apidocs
 
 apidocs:
-	pydoctor --intersphinx http://urllib3.readthedocs.org/en/latest/objects.inv --intersphinx http://docs.python.org/3/objects.inv --docformat=google dulwich --project-url=https://www.dulwich.io/
+	pydoctor --intersphinx http://urllib3.readthedocs.org/en/latest/objects.inv --intersphinx http://docs.python.org/3/objects.inv --docformat=google dulwich --project-url=https://www.dulwich.io/ --project-name=dulwich

+ 6 - 3
dulwich/porcelain.py

@@ -197,10 +197,13 @@ class TimezoneFormatError(Error):
 
 def parse_timezone_format(tz_str):
     """Parse given string and attempt to return a timezone offset.
+
     Different formats are considered in the following order:
-        - Git internal format: <unix timestamp> <timezone offset>
-        - RFC 2822: e.g. Mon, 20 Nov 1995 19:12:08 -0500
-        - ISO 8601: e.g. 1995-11-20T19:12:08-0500
+
+     - Git internal format: <unix timestamp> <timezone offset>
+     - RFC 2822: e.g. Mon, 20 Nov 1995 19:12:08 -0500
+     - ISO 8601: e.g. 1995-11-20T19:12:08-0500
+
     Args:
       tz_str: datetime string
     Returns: Timezone offset as integer