Skip to content

Commit

Permalink
Merge branch 'main' into test-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclotruc authored Jan 7, 2025
2 parents 8046a6b + 123f0ef commit 00e0794
Show file tree
Hide file tree
Showing 17 changed files with 186 additions and 180 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GitIngest
# Gitingest

[![Image](./docs/frontpage.png "GitIngest main page")](https://gitingest.com)
[![Image](./docs/frontpage.png "Gitingest main page")](https://gitingest.com)

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/cyclotruc/gitingest/blob/main/LICENSE)
[![PyPI version](https://badge.fury.io/py/gitingest.svg)](https://badge.fury.io/py/gitingest)
Expand Down Expand Up @@ -37,9 +37,9 @@ pip install gitingest
## 🧩 Browser Extension Usage

<!-- markdownlint-disable MD033 -->
<a href="https://chromewebstore.google.com/detail/adfjahbijlkjfoicpjkhjicpjpjfaood" target="_blank" title="Get GitIngest Extension from Chrome Web Store"><img height="48" src="https://github.com/user-attachments/assets/20a6e44b-fd46-4e6c-8ea6-aad436035753" alt="Available in the Chrome Web Store" /></a>
<a href="https://addons.mozilla.org/firefox/addon/gitingest/" target="_blank" title="Get GitIngest Extension from Firefox Add-ons"><img height="48" src="https://github.com/user-attachments/assets/c0e99e6b-97cf-4af2-9737-099db7d3538b" alt="Get The Add-on for Firefox" /></a>
<a href="https://microsoftedge.microsoft.com/addons/detail/nfobhllgcekbmpifkjlopfdfdmljmipf" target="_blank" title="Get GitIngest Extension from Firefox Add-ons"><img height="48" src="https://github.com/user-attachments/assets/204157eb-4cae-4c0e-b2cb-db514419fd9e" alt="Get from the Edge Add-ons" /></a>
<a href="https://chromewebstore.google.com/detail/adfjahbijlkjfoicpjkhjicpjpjfaood" target="_blank" title="Get Gitingest Extension from Chrome Web Store"><img height="48" src="https://github.com/user-attachments/assets/20a6e44b-fd46-4e6c-8ea6-aad436035753" alt="Available in the Chrome Web Store" /></a>
<a href="https://addons.mozilla.org/firefox/addon/gitingest/" target="_blank" title="Get Gitingest Extension from Firefox Add-ons"><img height="48" src="https://github.com/user-attachments/assets/c0e99e6b-97cf-4af2-9737-099db7d3538b" alt="Get The Add-on for Firefox" /></a>
<a href="https://microsoftedge.microsoft.com/addons/detail/nfobhllgcekbmpifkjlopfdfdmljmipf" target="_blank" title="Get Gitingest Extension from Firefox Add-ons"><img height="48" src="https://github.com/user-attachments/assets/204157eb-4cae-4c0e-b2cb-db514419fd9e" alt="Get from the Edge Add-ons" /></a>
<!-- markdownlint-enable MD033 -->

The extension is open source at [lcandy2/gitingest-extension](https://github.com/lcandy2/gitingest-extension).
Expand Down
6 changes: 4 additions & 2 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
""" Configuration file for the project. """

from pathlib import Path

MAX_DISPLAY_SIZE: int = 300_000
TMP_BASE_PATH: str = "/tmp/gitingest"
TMP_BASE_PATH = Path("/tmp/gitingest")
DELETE_REPO_AFTER: int = 60 * 60 # In seconds

EXAMPLE_REPOS: list[dict[str, str]] = [
{"name": "GitIngest", "url": "https://github.com/cyclotruc/gitingest"},
{"name": "Gitingest", "url": "https://github.com/cyclotruc/gitingest"},
{"name": "FastAPI", "url": "https://github.com/tiangolo/fastapi"},
{"name": "Flask", "url": "https://github.com/pallets/flask"},
{"name": "Tldraw", "url": "https://github.com/tldraw/tldraw"},
Expand Down
2 changes: 1 addition & 1 deletion src/gitingest/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Command-line interface for the GitIngest package. """
""" Command-line interface for the Gitingest package. """

# pylint: disable=no-value-for-parameter

Expand Down
2 changes: 1 addition & 1 deletion src/gitingest/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Custom exceptions for the GitIngest package. """
""" Custom exceptions for the Gitingest package. """


class InvalidPatternError(ValueError):
Expand Down
2 changes: 1 addition & 1 deletion src/gitingest/ignore_patterns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Default ignore patterns for GitIngest. """
""" Default ignore patterns for Gitingest. """

DEFAULT_IGNORE_PATTERNS: list[str] = [
# Python
Expand Down
8 changes: 4 additions & 4 deletions src/gitingest/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import inspect
import shutil

from config import TMP_BASE_PATH
from gitingest.clone import CloneConfig, clone_repo
from gitingest.ingest_from_query import ingest_from_query
from gitingest.parse_query import parse_query
Expand Down Expand Up @@ -63,7 +64,7 @@ def ingest(
# Extract relevant fields for CloneConfig
clone_config = CloneConfig(
url=query["url"],
local_path=query["local_path"],
local_path=str(query["local_path"]),
commit=query.get("commit"),
branch=query.get("branch"),
)
Expand All @@ -84,6 +85,5 @@ def ingest(
finally:
# Clean up the temporary directory if it was created
if query["url"]:
# Clean up the temporary directory under /tmp/gitingest
cleanup_path = "/tmp/gitingest"
shutil.rmtree(cleanup_path, ignore_errors=True)
# Clean up the temporary directory
shutil.rmtree(TMP_BASE_PATH, ignore_errors=True)
Loading

0 comments on commit 00e0794

Please sign in to comment.