Skip to content

Commit 10e2630

Browse files
committed
Add .gitignore to plugin generator
1 parent 6f0ec03 commit 10e2630

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

scripts/create_provider_plugin.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,65 @@ def _display(p: str) -> str:
519519
print("✓ Created README.md with usage examples")
520520

521521

522+
def create_gitignore(base_dir: Path) -> None:
523+
"""Create .gitignore file with Python-specific entries."""
524+
gitignore_content = textwrap.dedent("""\
525+
# Python
526+
__pycache__/
527+
*.py[cod]
528+
*$py.class
529+
*.so
530+
531+
# Distribution / packaging
532+
build/
533+
dist/
534+
*.egg-info/
535+
.eggs/
536+
*.egg
537+
538+
# Virtual environments
539+
.env
540+
.venv
541+
env/
542+
venv/
543+
ENV/
544+
545+
# Testing & coverage
546+
.pytest_cache/
547+
.tox/
548+
htmlcov/
549+
.coverage
550+
.coverage.*
551+
552+
# Type checking
553+
.mypy_cache/
554+
.dmypy.json
555+
dmypy.json
556+
.pytype/
557+
558+
# IDEs
559+
.idea/
560+
.vscode/
561+
*.swp
562+
*.swo
563+
564+
# OS-specific
565+
.DS_Store
566+
Thumbs.db
567+
568+
# Logs
569+
*.log
570+
571+
# Temp files
572+
*.tmp
573+
*.bak
574+
*.backup
575+
""")
576+
577+
(base_dir / ".gitignore").write_text(gitignore_content, encoding="utf-8")
578+
print("✓ Created .gitignore file with Python-specific entries")
579+
580+
522581
def create_license(base_dir: Path) -> None:
523582
"""Create LICENSE file."""
524583
license_content = textwrap.dedent("""\
@@ -701,6 +760,7 @@ def create_plugin(
701760
base_dir, args.provider_name, package_name, patterns, args.with_schema
702761
)
703762
create_readme(base_dir, args.provider_name, package_name, patterns)
763+
create_gitignore(base_dir)
704764
create_license(base_dir)
705765

706766
return base_dir

0 commit comments

Comments
 (0)