Skip to content

Commit 18444c3

Browse files
Enforce double quotes by removing skip-string-normalization from black config
1 parent 16c8abf commit 18444c3

15 files changed

+195
-196
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@ repos:
44
hooks:
55
# Files
66
- id: check-added-large-files
7-
description: 'Prevent large files from being committed.'
8-
args: ['--maxkb=10000']
7+
description: "Prevent large files from being committed."
8+
args: ["--maxkb=10000"]
99
- id: check-case-conflict
10-
description: 'Check for files that would conflict in case-insensitive filesystems.'
10+
description: "Check for files that would conflict in case-insensitive filesystems."
1111
- id: fix-byte-order-marker
12-
description: 'Remove utf-8 byte order marker.'
12+
description: "Remove utf-8 byte order marker."
1313
- id: mixed-line-ending
14-
description: 'Replace mixed line ending.'
14+
description: "Replace mixed line ending."
1515

1616
# Links
1717
- id: destroyed-symlinks
18-
description: 'Detect symlinks which are changed to regular files with a content of a path which that symlink was pointing to.'
18+
description: "Detect symlinks which are changed to regular files with a content of a path which that symlink was pointing to."
1919

2020
# File files for parseable syntax: python
2121
- id: check-ast
2222

2323
# File and line endings
2424
- id: end-of-file-fixer
25-
description: 'Ensure that a file is either empty, or ends with one newline.'
25+
description: "Ensure that a file is either empty, or ends with one newline."
2626
- id: trailing-whitespace
27-
description: 'Trim trailing whitespace.'
27+
description: "Trim trailing whitespace."
2828

2929
# Python
3030
- id: check-docstring-first
31-
description: 'Check a common error of defining a docstring after code.'
31+
description: "Check a common error of defining a docstring after code."
3232
- id: requirements-txt-fixer
33-
description: 'Sort entries in requirements.txt.'
33+
description: "Sort entries in requirements.txt."
3434

3535
- repo: https://github.com/MarcoGorelli/absolufy-imports
3636
rev: v0.3.1
3737
hooks:
3838
- id: absolufy-imports
39-
description: 'Automatically convert relative imports to absolute. (Use `args: [--never]` to revert.)'
39+
description: "Automatically convert relative imports to absolute. (Use `args: [--never]` to revert.)"
4040

4141
- repo: https://github.com/psf/black
4242
rev: 24.10.0
@@ -47,30 +47,30 @@ repos:
4747
rev: v3.19.1
4848
hooks:
4949
- id: pyupgrade
50-
description: 'Automatically upgrade syntax for newer versions.'
50+
description: "Automatically upgrade syntax for newer versions."
5151
args: [--py3-plus, --py36-plus, --py38-plus, --py39-plus, --py310-plus]
5252

5353
- repo: https://github.com/pre-commit/pygrep-hooks
5454
rev: v1.10.0
5555
hooks:
5656
- id: python-check-blanket-noqa
57-
description: 'Enforce that `noqa` annotations always occur with specific codes. Sample annotations: `# noqa: F401`, `# noqa: F401,W203`.'
57+
description: "Enforce that `noqa` annotations always occur with specific codes. Sample annotations: `# noqa: F401`, `# noqa: F401,W203`."
5858
- id: python-check-blanket-type-ignore
59-
description: 'Enforce that `# type: ignore` annotations always occur with specific codes. Sample annotations: `# type: ignore[attr-defined]`, `# type: ignore[attr-defined, name-defined]`.'
59+
description: "Enforce that `# type: ignore` annotations always occur with specific codes. Sample annotations: `# type: ignore[attr-defined]`, `# type: ignore[attr-defined, name-defined]`."
6060
- id: python-use-type-annotations
61-
description: 'Enforce that python3.6+ type annotations are used instead of type comments.'
61+
description: "Enforce that python3.6+ type annotations are used instead of type comments."
6262

6363
- repo: https://github.com/PyCQA/isort
6464
rev: 5.13.2
6565
hooks:
6666
- id: isort
67-
description: 'Sort imports alphabetically, and automatically separated into sections and by type.'
67+
description: "Sort imports alphabetically, and automatically separated into sections and by type."
6868

6969
- repo: https://github.com/hadialqattan/pycln
7070
rev: v2.4.0
7171
hooks:
7272
- id: pycln
73-
description: 'Remove unused import statements.'
73+
description: "Remove unused import statements."
7474

7575
- repo: https://github.com/djlint/djLint
7676
rev: v1.36.4

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ filter_files = true
1414

1515
[tool.black]
1616
line-length = 119
17-
skip-string-normalization = true

src/gitingest/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def normalize_pattern(pattern: str) -> str:
1515

1616

1717
@click.command()
18-
@click.argument('source', type=str, required=True)
19-
@click.option('--output', '-o', default=None, help='Output file path (default: <repo_name>.txt in current directory)')
20-
@click.option('--max-size', '-s', default=MAX_FILE_SIZE, help='Maximum file size to process in bytes')
21-
@click.option('--exclude-pattern', '-e', multiple=True, help='Patterns to exclude')
22-
@click.option('--include-pattern', '-i', multiple=True, help='Patterns to include')
18+
@click.argument("source", type=str, required=True)
19+
@click.option("--output", "-o", default=None, help="Output file path (default: <repo_name>.txt in current directory)")
20+
@click.option("--max-size", "-s", default=MAX_FILE_SIZE, help="Maximum file size to process in bytes")
21+
@click.option("--exclude-pattern", "-e", multiple=True, help="Patterns to exclude")
22+
@click.option("--include-pattern", "-i", multiple=True, help="Patterns to include")
2323
def main(
2424
source: str,
2525
output: str | None,
@@ -46,5 +46,5 @@ def main(
4646
raise click.Abort()
4747

4848

49-
if __name__ == '__main__':
49+
if __name__ == "__main__":
5050
main()

src/gitingest/clone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async def clone_repo(config: CloneConfig) -> tuple[bytes, bytes]:
130130
checkout_cmd = ["git", "-C", local_path, "checkout", commit]
131131
return await run_git_command(*checkout_cmd)
132132

133-
if branch and branch.lower() not in ('main', 'master'):
133+
if branch and branch.lower() not in ("main", "master"):
134134
# Scenario 2: Clone a specific branch with shallow depth
135135
clone_cmd = ["git", "clone", "--depth=1", "--single-branch", "--branch", branch, url, local_path]
136136
return await run_git_command(*clone_cmd)

src/gitingest/ignore_patterns.py

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,100 @@
11
DEFAULT_IGNORE_PATTERNS: list[str] = [
22
# Python
3-
'*.pyc',
4-
'*.pyo',
5-
'*.pyd',
6-
'__pycache__',
7-
'.pytest_cache',
8-
'.coverage',
9-
'.tox',
10-
'.nox',
11-
'.mypy_cache',
12-
'.ruff_cache',
13-
'.hypothesis',
14-
'poetry.lock',
15-
'Pipfile.lock',
3+
"*.pyc",
4+
"*.pyo",
5+
"*.pyd",
6+
"__pycache__",
7+
".pytest_cache",
8+
".coverage",
9+
".tox",
10+
".nox",
11+
".mypy_cache",
12+
".ruff_cache",
13+
".hypothesis",
14+
"poetry.lock",
15+
"Pipfile.lock",
1616
# JavaScript/Node
17-
'node_modules',
18-
'bower_components',
19-
'package-lock.json',
20-
'yarn.lock',
21-
'.npm',
22-
'.yarn',
23-
'.pnpm-store',
17+
"node_modules",
18+
"bower_components",
19+
"package-lock.json",
20+
"yarn.lock",
21+
".npm",
22+
".yarn",
23+
".pnpm-store",
2424
# Version control
25-
'.git',
26-
'.svn',
27-
'.hg',
28-
'.gitignore',
29-
'.gitattributes',
30-
'.gitmodules',
25+
".git",
26+
".svn",
27+
".hg",
28+
".gitignore",
29+
".gitattributes",
30+
".gitmodules",
3131
# Images and media
32-
'*.svg',
33-
'*.png',
34-
'*.jpg',
35-
'*.jpeg',
36-
'*.gif',
37-
'*.ico',
38-
'*.pdf',
39-
'*.mov',
40-
'*.mp4',
41-
'*.mp3',
42-
'*.wav',
32+
"*.svg",
33+
"*.png",
34+
"*.jpg",
35+
"*.jpeg",
36+
"*.gif",
37+
"*.ico",
38+
"*.pdf",
39+
"*.mov",
40+
"*.mp4",
41+
"*.mp3",
42+
"*.wav",
4343
# Virtual environments
44-
'venv',
45-
'.venv',
46-
'env',
47-
'.env',
48-
'virtualenv',
44+
"venv",
45+
".venv",
46+
"env",
47+
".env",
48+
"virtualenv",
4949
# IDEs and editors
50-
'.idea',
51-
'.vscode',
52-
'.vs',
53-
'*.swp',
54-
'*.swo',
55-
'*.swn',
56-
'.settings',
57-
'.project',
58-
'.classpath',
59-
'*.sublime-*',
50+
".idea",
51+
".vscode",
52+
".vs",
53+
"*.swp",
54+
"*.swo",
55+
"*.swn",
56+
".settings",
57+
".project",
58+
".classpath",
59+
"*.sublime-*",
6060
# Temporary and cache files
61-
'*.log',
62-
'*.bak',
63-
'*.swp',
64-
'*.tmp',
65-
'*.temp',
66-
'.cache',
67-
'.sass-cache',
68-
'.eslintcache',
69-
'.DS_Store',
70-
'Thumbs.db',
71-
'desktop.ini',
61+
"*.log",
62+
"*.bak",
63+
"*.swp",
64+
"*.tmp",
65+
"*.temp",
66+
".cache",
67+
".sass-cache",
68+
".eslintcache",
69+
".DS_Store",
70+
"Thumbs.db",
71+
"desktop.ini",
7272
# Build directories and artifacts
73-
'build',
74-
'dist',
75-
'target',
76-
'out',
77-
'*.egg-info',
78-
'*.egg',
79-
'*.whl',
80-
'*.so',
81-
'*.dylib',
82-
'*.dll',
83-
'*.class',
73+
"build",
74+
"dist",
75+
"target",
76+
"out",
77+
"*.egg-info",
78+
"*.egg",
79+
"*.whl",
80+
"*.so",
81+
"*.dylib",
82+
"*.dll",
83+
"*.class",
8484
# Documentation
85-
'site-packages',
86-
'.docusaurus',
87-
'.next',
88-
'.nuxt',
85+
"site-packages",
86+
".docusaurus",
87+
".next",
88+
".nuxt",
8989
# Other common patterns
9090
## Minified files
91-
'*.min.js',
92-
'*.min.css',
91+
"*.min.js",
92+
"*.min.css",
9393
## Source maps
94-
'*.map',
94+
"*.map",
9595
## Terraform
96-
'.terraform',
97-
'*.tfstate*',
96+
".terraform",
97+
"*.tfstate*",
9898
## Dependencies in various languages
99-
'vendor/',
99+
"vendor/",
100100
]

src/gitingest/ingest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ def ingest(
2323
include_patterns=include_patterns,
2424
ignore_patterns=exclude_patterns,
2525
)
26-
if query['url']:
26+
if query["url"]:
2727

2828
# Extract relevant fields for CloneConfig
2929
clone_config = CloneConfig(
3030
url=f"https://github.com/{query['slug']}.git",
31-
local_path=query['local_path'],
32-
commit=query.get('commit'),
33-
branch=query.get('branch'),
31+
local_path=query["local_path"],
32+
commit=query.get("commit"),
33+
branch=query.get("branch"),
3434
)
3535
clone_result = clone_repo(clone_config)
3636

@@ -49,7 +49,7 @@ def ingest(
4949

5050
finally:
5151
# Clean up the temporary directory if it was created
52-
if query['url']:
52+
if query["url"]:
5353
# Get parent directory two levels up from local_path (../tmp)
54-
cleanup_path = str(Path(query['local_path']).parents[1])
54+
cleanup_path = str(Path(query["local_path"]).parents[1])
5555
shutil.rmtree(cleanup_path, ignore_errors=True)

0 commit comments

Comments
 (0)