-
Notifications
You must be signed in to change notification settings - Fork 911
refactor: Refactor output formatting #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ab6eb5f
test
NicolasIRAGNE b82624c
wip before jinja
NicolasIRAGNE 0765f0e
idk
NicolasIRAGNE 78695f9
idk
NicolasIRAGNE e1f687c
idk
NicolasIRAGNE 0e6c5bf
commit avant la catastrophe
NicolasIRAGNE 6d2941b
commit post catastrophe
NicolasIRAGNE fcb7e01
wip
NicolasIRAGNE 8e7070d
feat: add GitRepository Type
NicolasIRAGNE 8a46848
fix: clean up Jinja templates for better readability
NicolasIRAGNE 3abac0b
feat: add unit tests for output formatting and enhance file system sc...
NicolasIRAGNE 1f3f3af
feat: extract formatter templates to files and rename Context to Cont...
NicolasIRAGNE 9a717c7
feat: move contextv1 to its own file
NicolasIRAGNE 175d5c2
fix: resolve all pre-commit hook issues and lint warnings
NicolasIRAGNE 6b680c7
typo
NicolasIRAGNE f4580c0
typo
NicolasIRAGNE 9a4e6f6
wip
NicolasIRAGNE File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
src/gitingest/format/DebugFormatter/Source.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{ SEPARATOR }} | ||
DEBUG: {{ class_name }} | ||
Fields: {{ fields_str }} | ||
{{ SEPARATOR }} |
11 changes: 11 additions & 0 deletions
src/gitingest/format/DefaultFormatter/ContextV1.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Generated using https://gitingest.com/{{ source.query.user_name }}/{{ source.query.repo_name }}{{ source.query.subpath }} | ||
|
||
Sources used: | ||
{%- for src in source %} | ||
- {{ src.name }}: {{ src.__class__.__name__ }} | ||
{% endfor %} | ||
|
||
{%- for src in source.sources %} | ||
{{ formatter.format(src, source.query) }} | ||
{%- endfor %} | ||
# End of https://gitingest.com/{{ source.query.user_name }}/{{ source.query.repo_name }}{{ source.query.subpath }} |
7 changes: 7 additions & 0 deletions
src/gitingest/format/DefaultFormatter/FileSystemDirectory.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{%- if source.depth == 0 %}{{ source.name }}: | ||
{{ source.tree }} | ||
|
||
{% endif -%} | ||
{%- for child in source.children -%} | ||
{{ formatter.format(child, query) }} | ||
{%- endfor -%} |
4 changes: 4 additions & 0 deletions
src/gitingest/format/DefaultFormatter/FileSystemFile.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{ SEPARATOR }} | ||
{{ source.name }} | ||
{{ SEPARATOR }} | ||
{{ source.content }} |
3 changes: 3 additions & 0 deletions
src/gitingest/format/DefaultFormatter/FileSystemSymlink.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{ SEPARATOR }} | ||
{{ source.name }}{% if source.target %} -> {{ source.target }}{% endif %} | ||
{{ SEPARATOR }} |
7 changes: 7 additions & 0 deletions
src/gitingest/format/DefaultFormatter/GitRepository.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{%- if source.depth == 0 %}🔗 Git Repository: {{ source.name }} | ||
{{ source.tree }} | ||
|
||
{% endif -%} | ||
{%- for child in source.children -%} | ||
{{ formatter.format(child, query) }} | ||
{%- endfor -%} |
5 changes: 5 additions & 0 deletions
src/gitingest/format/SummaryFormatter/ContextV1.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Repository: {{ source.query.user_name }}/{{ source.query.repo_name }} | ||
Commit: {{ source.query.commit }} | ||
Files analyzed: {{ source.file_count }} | ||
|
||
Estimated tokens: {{ source.token_count }} |
2 changes: 2 additions & 0 deletions
src/gitingest/format/SummaryFormatter/FileSystemDirectory.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Directory structure: | ||
{{ source.tree }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.