Skip to content

Commit

Permalink
Fix flake8 linting errors
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
pedro-psb committed Mar 20, 2024
1 parent 77425be commit e292385
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/pulp_docs/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import subprocess
import sys
import tempfile
from pathlib import Path

import click
Expand Down
6 changes: 4 additions & 2 deletions src/pulp_docs/mkdocs_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def _place_doc_files(src_dir: Path, docs_dir: Path, repo: Repo):
# Create placeholder, case it was not possible to fetch one
empty_changelog = changes_dir / "changelog.md"
empty_changelog.write_text(
"# Changelog\n\nThe repository does not provide a changelog or there was a problem fetching it."
"# Changelog\n\nThe repository does not provide a changelog or"
"there was a problem fetching it."
)


Expand Down Expand Up @@ -222,7 +223,8 @@ def print_user_repo(repos: Repos, config: Config):
# TODO: improve this refspec comparision heuristics
if repo.branch not in repo.branch_in_use:
warn_msgs.append(
f"[pulp-docs] Original {repo.name!r} ref is {repo.branch!r}, but local one is '{repo.branch_in_use}'."
f"[pulp-docs] Original {repo.name!r} ref is {repo.branch!r},"
f"but local one is '{repo.branch_in_use}'."
)

if len(local_checkouts) == 0:
Expand Down
8 changes: 0 additions & 8 deletions src/pulp_docs/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
from __future__ import annotations

import logging
import os
import shutil
import subprocess
import tarfile
import tempfile
import typing as t
from collections import ChainMap, defaultdict
from dataclasses import dataclass, field
from io import BytesIO
from pathlib import Path
Expand Down Expand Up @@ -68,10 +66,6 @@ class Repo:
def __post_init__(self):
self.branch_in_use = self.branch_in_use or self.branch

@property
def rest_api_link(self):
return RESTAPI_TEMPLATE.format(self.name)

def download(self, dest_dir: Path, clear_cache: bool = False) -> str:
"""
Download repository source from url into the {dest_dir} Path.
Expand Down Expand Up @@ -162,8 +156,6 @@ def download_from_gh_latest(dest_dir: Path, owner: str, name: str):
"""
Download repository source-code from latest GitHub Release (w/ GitHub API).
See: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release
Returns the download url.
"""
latest_release_link_url = (
Expand Down
13 changes: 9 additions & 4 deletions src/pulp_docs/utils/aggregation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import re
import typing as t
from pathlib import Path

Expand Down Expand Up @@ -67,9 +66,15 @@ def repo_grouping(
Get all markdown files that matches @template_str basepath and group by repos.
Arguments:
template_str: The template with fields to expand. Accepts combination of '{repo}' and '{content}'
repo_types: The set of repos to use. Accepts list with combination of "core", "content" and "other"
content_types: The set of content-types to use. Accepts combination of "guides", "learn" and "tutorial"
template_str:
The template with fields to expand.
Accepts combination of '{repo}' and '{content}'
repo_types:
The set of repos to use.
Accepts list with combination of "core", "content" and "other"
content_types:
The set of content-types to use.
Accepts combination of "guides", "learn" and "tutorial"
Example:
```python
Expand Down

0 comments on commit e292385

Please sign in to comment.