Author SHA1 Message Date
Srikanth Patchava fceedfce23 Merge 4cfd0b81b3 into 57286c3887 2026-07-24 01:20:57 -04:00
Devin Dooley 57286c3887 Merge pull request #4873 from lissy93-forks/updates-laravel-phpcache-dir
Updates missing .phpunit.cache dir for newer laravel
2026-07-23 09:06:44 -07:00
Alicia Sykes 90db345f0d Updates missing .phpunit.cache dir for newer laravel 2026-06-07 21:00:00 +01:00
Daniel Johnson dcc0fc7bc2 Merge pull request #4700 from G0rocks/main
Add FreeCAD.gitignore file
2026-05-21 16:49:32 -07:00
Devin Dooley 3780fff86c Merge pull request #4801 from NoahGreer/update-godot-gitignore-template
Update Godot.gitignore
2026-05-18 09:18:31 -07:00
Srikanth Patchava 4cfd0b81b3 test: add pytest tests for template validator
Comprehensive test suite covering glob validation, trailing
whitespace detection, duplicate and conflict detection,
coverage analysis, and report formatting.

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
2026-05-16 09:30:28 -07:00
Srikanth Patchava afdec22fa1 fix: add script to strip trailing whitespace from templates
Trailing whitespace in .gitignore patterns can cause unexpected
behavior. This script detects and removes trailing whitespace
from template files with dry-run support.

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
2026-05-16 09:30:28 -07:00
Srikanth Patchava 46742213f6 feat: add .gitignore template validator script
Add a comprehensive template validation tool that checks for:
- Valid glob pattern syntax
- Duplicate pattern detection
- Conflicting include/exclude rules
- Coverage analysis with suggestions
- CLI interface with argparse
- Detailed reporting (errors, warnings, suggestions)
- Support for processing all templates in the repo

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
2026-05-16 09:30:28 -07:00
Srikanth Patchava 7d476866ad feat: add Zephyr RTOS .gitignore template
Add gitignore template for Zephyr RTOS projects covering:
- Build artifacts and twister output
- Generated config/devicetree files
- West workspace metadata
- Python virtual environments
2026-05-16 09:30:28 -07:00
Devin Dooley ca6c873762 Merge pull request #4728 from TimHatchard/lasal-gitignore
Add SIGMATEK Automation's LASAL gitignore
2026-05-15 16:15:08 -07:00
Devin Dooley 7338c62e90 Merge pull request #4827 from arllemfarias/patch-1
Update MATLAB.gitignore
2026-05-15 16:07:29 -07:00
Devin Dooley 3407009677 Merge pull request #4860 from bac0id/bac0id/remove-empty-lines-cpp
Remove empty line in C++.gitignore
2026-05-15 16:06:04 -07:00
Devin Dooley 8224d3117f Merge pull request #4719 from robbiemu/ai-agents
adds common AI agents and assistants configuration files and folder
2026-05-15 15:57:48 -07:00
BAC e5414fa4fe Remove empty line in .gitignore 2026-05-10 17:09:15 +08:00
robbiemu cff16449a5 added codex opt-in 2026-05-08 13:20:32 -04:00
robbiemu 8f2f1edc2c Move AI agents template to Global and scope default ignores
Keep only documented local/high-churn agent artifacts active by default, preserving common shared instruction/config files as commented opt-in examples
2026-05-08 13:16:54 -04:00
G0rocks 314d381f1e Add *.FCBak to FreeCAD.gitignore 2026-05-03 16:26:41 +00:00
G0rocks 6a98aacd54 Move FreeCAD.gitignore to community folder 2026-05-03 16:24:48 +00:00
Huldar 9275edaddf Merge branch 'github:main' into main 2026-05-03 16:22:36 +00:00
Devin Dooley 1046d8fba6 Merge pull request #4846 from yufeiminds/main
Add .gitignore for MoonBit
2026-04-27 09:16:09 -07:00
Yufei Li b632b12ac9 fix: Fix comment style issues 2026-04-27 15:21:45 +08:00
Devin Dooley 5763345204 Merge pull request #4731 from gsilvan/main
Fix Python.gitignore for celery-beat
2026-04-24 14:32:31 -07:00
Devin Dooley a5221917b7 Merge pull request #4730 from joaodinissf/patch-1
Fix typo "wrappper" --> "wrapper" in Gradle.gitignore
2026-04-24 14:31:30 -07:00
Devin Dooley 68275fc7aa Merge pull request #4727 from RiseT/patch-2
Update VisualStudioCode.gitignore
2026-04-24 14:26:49 -07:00
Devin Dooley 6abe9c03f6 Merge pull request #4726 from RiseT/patch-1
Update Python.gitignore (pixi)
2026-04-24 14:26:09 -07:00
Devin Dooley 42f7c40623 Merge pull request #4724 from elliotwutingfeng/patch-1
Add *.lcov to Python gitignore
2026-04-24 14:16:26 -07:00
Devin Dooley 618ab22d7c Merge pull request #4847 from putku45/putku45-patch-1
Fix grammar and improve clarity in README
2026-04-24 13:58:54 -07:00
Devin Dooley 1db6a7cf87 Merge pull request #4848 from andreww2012/fix/move-trailing-comments
fix: avoid using trailing comments as gitignore doesn't support them
2026-04-24 13:58:04 -07:00
Devin Dooley c62fbb7967 Merge pull request #4849 from demosdemon/patch-1
Update Rust.gitignore to include rustc-ice files
2026-04-24 13:53:41 -07:00
Devin Dooley 9a2ae1c470 Merge pull request #4851 from nard-tech/nard-tech-patch-1
Fix lowercase letter in WordPress.gitignore comment
2026-04-24 13:47:20 -07:00
Fujita Shu 322d56fec4 Fix lowercase letter in WordPress.gitignore comment
corrected the lowercase letters that should have been uppercase.
2026-04-24 12:06:30 +09:00
Brandon LeBlanc ccf8d89c54 Update Rust.gitignore to include rustc-ice files
Add rustc internal compiler error stack trace files to ignore
2026-04-23 08:34:45 -07:00
Andrew KazakovandCopilot 14d5eadc15 fix: avoid using trailing comments as gitignore doesn't support them
Co-authored-by: Copilot <copilot@github.com>
2026-04-23 15:34:42 +03:00
putku45 b0202f339f Fix grammar and improve clarity in README
### Description
Improved grammar and clarity in the README file.

### Changes made
- Fixed pluralization ("project" → "projects")
- Improved sentence structure for better readability
- Added missing article ("a") in pull request sentence

### Why this is useful
- Improves readability and professionalism of documentation
- Helps maintain consistency across the repository
2026-04-23 14:00:16 +05:30
Devin Dooley 166ce88ec5 Merge pull request #4717 from lpalgarvio/patch-3
Update VirtualEnv.gitignore
2026-04-20 13:42:41 -07:00
Devin Dooley a4a12a4fa3 Merge pull request #4716 from lpalgarvio/patch-2
Update Backup.gitignore
2026-04-20 13:39:42 -07:00
Devin Dooley 622da0d813 Merge pull request #4715 from lpalgarvio/patch-1
Update Ansible.gitignore
2026-04-20 13:38:55 -07:00
Devin Dooley bef6d439ce Merge pull request #4706 from softwaredevelop/refactor-mql5-gitignore
Refactor .gitignore for MQL5: Clean up file extensions and improve clarity
2026-04-20 13:30:28 -07:00
Devin Dooley 1af287ee8a Merge pull request #4780 from SzymonHalucha/patch-1
Update Unity.gitignore to add new ignore patterns
2026-04-20 13:27:12 -07:00
Devin Dooley 90ef4aada1 Merge pull request #4734 from tigran-sargsyan-w/unity-patch
Add header note in Unity.gitignore about using Global editor/OS templates
2026-04-20 13:25:53 -07:00
Devin Dooley 248de8ed97 Merge pull request #4786 from christianbraeunlich/feature/al-bclicense
[AL] Ignore .bclicense file
2026-04-20 13:13:29 -07:00
Devin Dooley 24b539acec Merge pull request #2807 from lorenzleutgeb/patch-1
Create HOL.gitignore
2026-04-20 09:42:33 -07:00
Devin Dooley 25713eb3a5 Merge pull request #4808 from malheleco/oh-my-opencode
Add gitignore to exclude sisyphus directory files (oh-my-openagent formerly known as oh-my-opencode)
2026-04-20 09:32:49 -07:00
Bernd 5f5a92fcfe move gitignore template due to PR feedback 2026-04-20 09:11:43 +02:00
Yufei LI 47eaa84be9 fix: Remove bin 2026-04-20 01:14:53 +08:00
Yufei LI 4a96a23dfd fix: Remove deprecated folder and logs 2026-04-20 01:01:50 +08:00
Yufei LI 071d8034a4 Add .gitignore for MoonBit 2026-04-20 00:31:16 +08:00
Lorenz Leutgeb b42312254f Create HOL.gitignore 2026-04-18 18:24:37 +02:00
Devin Dooley 4d89c5d3e2 Merge pull request #4813 from danilofroes/solidworks-gitignore
Add gitignore for SolidWorks projects
2026-04-17 16:22:17 -07:00
Devin Dooley aef8819a8f Merge pull request #4815 from mvanhorn/osc/zed-gitignore
Add Zed editor to Global gitignore templates
2026-04-17 16:15:20 -07:00
Devin Dooley 8f5497c4be Merge pull request #4817 from mvanhorn/osc/tauri-gitignore
Add Tauri to community gitignore templates
2026-04-17 16:10:58 -07:00
Devin Dooley 70da24ee68 Merge pull request #4838 from add-uos/feat-qt-add-build-dir
feat(qt): add build directory to gitignore
2026-04-17 16:05:53 -07:00
Devin Dooley 4def375658 Merge pull request #4841 from DeflateAwning/deflateawning-kicad-v9-history
KiCad: Add `.history` folder to template
2026-04-17 15:57:09 -07:00
Daniel Johnson 1a7b75fb11 Merge pull request #4705 from EndrII/patch-2
[Qt/QML] Added .qmlls.ini to ignore
2026-04-17 15:00:07 -07:00
Daniel Johnson 81a7cc6c11 Merge pull request #4472 from Snox-dev1/main
Add bun.gitignore for Bun-based projects
2026-04-17 14:50:12 -07:00
Daniel Johnson 734bf73afa Merge pull request #4845 from github/remove-duplicate-ask
Removes duplicate project homepage ask
2026-04-17 14:46:20 -07:00
Daniel Johnson f86606d285 Merge pull request #4791 from kailando/main
Resolve merge conflicts for PR #4300
2026-04-17 14:45:42 -07:00
Daniel Johnson 61268c1e43 Merge pull request #4269 from dsplaisted/patch-2
Add .artifacts folder to Visual Studio .gitignore
2026-04-17 14:42:46 -07:00
Devin Dooley d958809c97 Merge pull request #4696 from jefferyto/macos-update
Update macOS.gitignore
2026-04-17 14:41:47 -07:00
Daniel Johnson 9947276662 Removes duplicate project homepage ask
We always want to know information about a project before we accept
changes in a PR.
2026-04-17 14:35:32 -07:00
DeflateAwning 5b24c9042d KiCad: Add .history folder to template 2026-04-11 23:33:55 -06:00
zhanghongyuan 7441291fc8 feat(qt): add build directory to gitignore 2026-04-07 10:27:46 +08:00
Arllem Farias 411ca2450b Update MATLAB.gitignore
Ignore auto-generated backup files
2026-03-28 11:51:24 -04:00
Tim Hatchard 6502030068 Update Lasal.gitignore with additional entries
Added maeexp and opcua entries
2026-03-27 16:00:32 +00:00
Noah Greer bf4440e850 Add rule for Godot temp extension library copies on Windows
As of Godot 4.2 the editor has a Windows-specific workaround for loading extension libraries.
Before the extension library is loaded the Godot editor creates a temp copy of the extension library `.dll` file with a `~` prefix (e.g. `example.dll` => `~example.dll`).
When the extension library is unloaded the Godot editor deletes the temp copy.
These copied `~*.dll` files are temporary and should be ignored.

References:

Godot 4.2 changelog
https://godotengine.org/article/godot-4-2-arrives-in-style/#gdextension

Godot PR #80188 GDExtension: Copy DLL to a temp file before opening
https://github.com/godotengine/godot/pull/80188
2026-03-23 10:12:22 -07:00
Tim Hatchard d36057a9f8 Added lob and lba exceptions for SigCLib
SigCLib requires the lob and lba files to load a project.
2026-03-20 08:53:26 +00:00
Matt Van Horn 3b288cfb37 Add Tauri to community gitignore templates 2026-03-17 15:35:54 -07:00
Matt Van Horn e81fea5f71 Add Zed editor to Global gitignore templates 2026-03-17 15:33:15 -07:00
Danilo Fróes c97a73771f Enhance SolidWorks.gitignore for case sensitivity
Added case-sensitive entries for SolidWorks temporary files and backups.
2026-03-15 16:36:41 -03:00
Danilo Fróes 7db9624f69 Add gitignore for SolidWorks projects 2026-03-15 16:22:30 -03:00
Bernd a850db9d75 Add gitignore to exclude sisyphus directory files
oh-my-opencode excludes the sisyphus working directory in their own repo, so it seems to be best practice. Also, the directory captures agent/runtime state, so it should not be shared.
2026-03-03 16:51:34 +01:00
RiseTandPavel Zwerschke f6eef37aba Update Python.gitignore (pixi)
That's what pixi itself adds to .gitignore when using "pixi init".

Co-authored-by: Pavel Zwerschke <pavelzw@gmail.com>
2026-03-01 12:44:51 +01:00
Silvan Gümüşdere 2a4ac93e79 ignore all files with celerybeat-schedule prefix 2026-01-28 09:42:08 +01:00
kailando 399559e0b7 Resolve merge conflicts for PR #4300 2026-01-25 15:33:17 -06:00
Christian Bräunlich 98608a890a Merge branch 'github:main' into feature/al-bclicense 2026-01-18 08:55:47 +01:00
Szymon Hałucha 315e8cbbbd Update Unity.gitignore to add new ignore patterns
Added entries to ignore .slnx files and scene dependency cache.
2026-01-03 09:41:43 +01:00
Robert Collins 844333a10b added .claude/ (by popular demand) and .gemini/ 2025-10-31 10:43:32 -05:00
Tigran Sargsyan e64eacaa89 Update Unity.gitignore with additional comments 2025-09-22 14:17:49 +02:00
João Dinis Ferreira 0befa5a8fd Fix typo "wrappper" --> "wrapper" in Gradle.gitignore 2025-09-14 18:29:27 +02:00
Theophylakto b7562cc78e Add LASAL gitignore 2025-09-08 10:06:47 +01:00
RiseT 33ce59b598 Update VisualStudioCode.gitignore
Add section title comment
2025-09-07 09:53:32 +02:00
Wu Tingfeng cd33ea10e8 Add *.lcov to Python gitignore 2025-09-01 01:17:02 +08:00
Robert Collins b5bf7e40ff adds common AI agents and assistants configuration files and folder 2025-08-25 10:36:18 -04:00
Luís Pedro Algarvio cf8b54d020 Update VirtualEnv.gitignore 2025-08-21 02:51:00 +01:00
Luís Pedro Algarvio add7cbcaad Update VirtualEnv.gitignore
Add extra rules
2025-08-21 02:33:54 +01:00
Luís Pedro Algarvio 3392aa92c2 Update Backup.gitignore
Add some descriptions and extra rules
2025-08-21 02:22:43 +01:00
Luís Pedro Algarvio 273b70134f Update Ansible.gitignore
Add descriptions for ansible entries
2025-08-21 02:16:47 +01:00
softwaredevelop 6b7a933304 Refactor .gitignore for MQL5: Clean up file extensions and improve clarity 2025-08-10 07:52:09 +00:00
Andrei Yankovich ebc4db855a Added .qmlls.ini to ignore
The **.qmlls.ini** files are auto generated files for qt creator qml language tool.

See documentation [QT_QML_GENERATE_QMLLS_INI](https://doc.qt.io/qt-6/cmake-variable-qt-qml-generate-qmlls-ini.html)
2025-08-08 19:49:49 +03:00
G0rocks 0a25801fa9 Add FreeCAD.gitignore file 2025-08-06 10:11:36 +00:00
Jeffery To c3b96313ed Add HFS+ directory for hard links to directories
https://wiki.sleuthkit.org/index.php?title=HFS#HFS.2B_Hard_Links
2025-07-30 07:14:07 +08:00
Memmie Lenglet a45008d646 Add orphaned file dir
https://www.howtogeek.com/282374/what-is-the-lostfound-folder-on-linux-and-macos/
2025-07-30 06:22:10 +08:00
Memmie Lenglet edd04dce90 Add TimeMachine recovery boot loader 2025-07-30 06:07:33 +08:00
Memmie Lenglet 52c2f9a7c5 Add disk label
https://refit.sourceforge.net/info/vollabel.html
grub-render-label(1)
https://web.archive.org/web/20201023104810/https://opensource.apple.com/source/kext_tools/kext_tools-623.120.1/bootcaches.plist.auto.html
2025-07-30 06:05:22 +08:00
Memmie Lenglet 1141dbc87f Add TimeMachine dirs
https://web.archive.org/web/20190101000001/https://www.baligu.com/pondini/TM/Works2.html
https://web.archive.org/web/20201210025437/https://www.baligu.com/pondini/TM/30.html
/System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist
2025-07-30 05:52:25 +08:00
Memmie Lenglet 08a7300667 Add system file reference dirs
/.vol/234881034/105486 is file #105486 on volume #234881034
https://developer.apple.com/library/archive/qa/qa2001/qa1113.html

/.file/id=6571367.17424234/ is file #17424234 on device #6571367
https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/AccessingFilesandDirectories/AccessingFilesandDirectories.html#//apple_ref/doc/uid/TP40010672-CH3-SW6
https://apple.stackexchange.com/questions/231447/is-it-normal-to-have-a-hidden-file-named-file-in/
2025-07-30 05:46:22 +08:00
Memmie Lenglet 51d9679541 Add quota system files
http://novosial.org/osx/quota/index.html
https://web.archive.org/web/20150906150310/http://hints.macworld.com/article.php?story=20030808130810285
https://www.cnet.com/news/how-to-limit-user-disk-space-with-partitions-and-quotas-in-os-x/
2025-07-30 05:42:00 +08:00
Memmie Lenglet 9e92df704e Add file used by HFS+ to handle the metadata zone
https://developer.apple.com/library/archive/technotes/tn/tn1150.html#HotFile
2025-07-30 05:37:07 +08:00
Memmie Lenglet 647cae16e7 Add folders used for software updates and app sandboxing 2025-07-30 05:33:11 +08:00
Memmie Lenglet b27567d5be Add flag file created by Spotlight
Flag file indicate that the drive can be used by Time Machine as a backup target
2025-07-30 05:21:38 +08:00
Memmie Lenglet 7b33adcda3 Add Mac OS 6 to 9 specific files
Metas databases (https://web.archive.org/web/20230328234043/https://support.apple.com/kb/TA46427?locale=en_US), Sherlock settings, Find By Content indexer folders (https://netatalk.io/docs/Special-Files-and-Folders, https://www.kb.cert.org/vuls/id/177243/)
2025-07-30 05:19:57 +08:00
Memmie Lenglet 1b3fb86582 Rename section
Files that start with ._ are resource forks: https://en.wikipedia.org/wiki/Resource_fork#Macintosh_file_systems
2025-07-30 05:15:04 +08:00
Snox e18a850340 Add bun.gitignore for Bun-based projects
This pull request adds a .gitignore file specifically designed for projects using Bun as a package manager. The bun.gitignore file includes rules to ignore common files and directories generated during development with Bun, as well as other tools and frameworks frequently used in conjunction with Bun.
2024-06-22 01:49:19 +02:00
Daniel Plaisted 21fc4d99eb Add .artifacts folder to Visual Studio .gitignore
We are planning to add a [new output path format](https://github.com/dotnet/designs/pull/281) to .NET projects which will by default put output in an `.artifacts` folder.  So this PR adds that folder to the Visual Studio .gitignore file.

The first support for this will be in .NET 8 Preview 3.  We will be looking for feedback through the preview process, so it's possible that the folder name or other aspects of the design could change as a result.
2023-03-24 15:04:00 -04:00
christianbraeunlich 63caeed028 Merge branch 'github:main' into feature/al-bclicense 2022-05-22 00:54:08 +02:00
Christian Bräunlich 14fea44fd5 correct to plural 2022-04-25 20:24:26 +02:00
Christian Bräunlich be40b2ed2c ignore bclicense files 2022-04-25 20:14:55 +02:00
38 changed files with 1290 additions and 83 deletions

No files matched your search

-4
View File
@@ -19,10 +19,6 @@ _TODO_
Link to the project docs, any existing .gitignore files that project may have in its own repo, etc Link to the project docs, any existing .gitignore files that project may have in its own repo, etc
---> --->
### If this is a new template
Link to application or project’s homepage: TODO
### Merge and Approval Steps ### Merge and Approval Steps
<!--- <!---
+2 -1
View File
@@ -16,7 +16,8 @@
rad.json rad.json
#Translation Base-file #Translation Base-file
*.g.xlf *.g.xlf
#License-file #License-files
*.bclicense
*.flf *.flf
#Test results file #Test results file
TestResults.xml TestResults.xml
-1
View File
@@ -23,7 +23,6 @@
*.dll *.dll
*.so.* *.so.*
# Fortran module files # Fortran module files
*.mod *.mod
*.smod *.smod
+68
View File
@@ -0,0 +1,68 @@
# AI agents and assistants
#
# Some common agent instruction and project configuration files are listed
# below as commented-out examples. They are often intentionally committed and
# shared with a team, so only uncomment them if they are local-only in your
# project.
# GEMINI.md
# WARP.md
# CRUSH.md
# QWEN.md
# OpenAI Codex
# AGENTS.md
# .codex/
# Aider
.aider.input.history
.aider.chat.history.md
.aider.llm.history
.aider.tags.cache.v*
# .aiderignore
# Claude Code
.claude/*.local.json
.claude/**/*.log
CLAUDE.local.md
# .claude/
# Gemini CLI
gemini-debug.log
.gemini-clipboard/
# .gemini/
# Cursor AI
# .cursorrules
# .cursor/
# .cursor.json
# .cursor-settings.yaml
# Continue
# .continue/
# .continuerc.json
# Cline
# .cline/
# .clinerules
# cline.json
# Other agent/editor project config
# .warp/
# .crush/
# .codeium/
# .deepseek/
# .amazon-codewhisperer/
# .tabnineignore
# .tabnine/
# GitHub Copilot
# .github/copilot-instructions.md
# Windsurf Editor
# .windsurfrules
# .windsurf/
# Replit AI Development
# .replit
# replit.nix
+4 -1
View File
@@ -1,2 +1,5 @@
*.retry # The default root path for Ansible config files on the controller
.ansible/ .ansible/
# Retry files generated for failed Ansible playbook runs
*.retry
+12
View File
@@ -1,5 +1,17 @@
# Generic backup files
*.bak *.bak
*.back
*.backup
# Norton Ghost backup files
*.gho *.gho
# Generic original files
*.ori *.ori
*.orig *.orig
*.original
# Generic temporary files
*.tmp *.tmp
*.temp
*.temporary
+2 -1
View File
@@ -63,7 +63,8 @@ atlassian-ide-plugin.xml
# SonarLint plugin # SonarLint plugin
.idea/sonarlint/ .idea/sonarlint/
.idea/sonarlint.xml # see https://community.sonarsource.com/t/is-the-file-idea-idea-idea-sonarlint-xml-intended-to-be-under-source-control/121119 # see https://community.sonarsource.com/t/is-the-file-idea-idea-idea-sonarlint-xml-intended-to-be-under-source-control/121119
.idea/sonarlint.xml
# Crashlytics plugin (for Android Studio and IntelliJ) # Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml com_crashlytics_export_strings.xml
+1
View File
@@ -4,6 +4,7 @@
*.autosave *.autosave
*.slx.r* *.slx.r*
*.mdl.r* *.mdl.r*
*.bak
# Derived content-obscured files # Derived content-obscured files
*.p *.p
+2
View File
@@ -0,0 +1,2 @@
.sisyphus/*
!.sisyphus/rules/
+11 -3
View File
@@ -1,5 +1,16 @@
# Virtualenv # Virtualenv
# https://realpython.com/python-virtual-environments-a-primer/#the-virtualenv-project # https://realpython.com/python-virtual-environments-a-primer/#the-virtualenv-project
.venv/
venv/
.python-version
# pyenv: Simple Python Version Management
pyvenv.cfg
# pip: package installer for Python
pip-selfcheck.json
# Custom python interpreter
.Python .Python
[Bb]in [Bb]in
[Ii]nclude [Ii]nclude
@@ -7,6 +18,3 @@
[Ll]ib64 [Ll]ib64
[Ll]ocal [Ll]ocal
[Ss]cripts [Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json
+1
View File
@@ -1,3 +1,4 @@
# Visual Studio Code
.vscode/* .vscode/*
!.vscode/settings.json !.vscode/settings.json
!.vscode/tasks.json !.vscode/tasks.json
+10
View File
@@ -0,0 +1,10 @@
# Zed
# https://zed.dev/docs/configuring-zed#settings-files
#
# Zed stores project settings in a .zed/ directory, similar to .vscode/.
# By default, ignore the directory but allow commonly shared config files.
.zed/*
!.zed/settings.json
!.zed/tasks.json
!.zed/debug.json
+33 -2
View File
@@ -6,10 +6,10 @@ __MACOSX/
.LSOverride .LSOverride
Icon[␍] Icon[␍]
# Thumbnails # Resource forks
._* ._*
# Files that might appear in the root of a volume # Files and directories that might appear in the root of a volume
.DocumentRevisions-V100 .DocumentRevisions-V100
.fseventsd .fseventsd
.Spotlight-V100 .Spotlight-V100
@@ -17,6 +17,15 @@ Icon[ ]
.Trashes .Trashes
.VolumeIcon.icns .VolumeIcon.icns
.com.apple.timemachine.donotpresent .com.apple.timemachine.donotpresent
.com.apple.timemachine.supported
.PKInstallSandboxManager
.PKInstallSandboxManager-SystemSoftware
.hotfiles.btree
.vol
.file
.disk_label*
lost+found
.HFS+ Private Directory Data[␍]
# Directories potentially created on remote AFP share # Directories potentially created on remote AFP share
.AppleDB .AppleDB
@@ -24,3 +33,25 @@ Icon[ ]
Network Trash Folder Network Trash Folder
Temporary Items Temporary Items
.apdisk .apdisk
# Mac OS 6 to 9
Desktop DB
Desktop DF
TheFindByContentFolder
TheVolumeSettingsFolder
.FBCIndex
.FBCSemaphoreFile
.FBCLockFolder
# Quota system
.quota.group
.quota.user
.quota.ops.group
.quota.ops.user
# TimeMachine
Backups.backupdb
.MobileBackups
.MobileBackups.trash
MobileBackups.trash
tmbootpicker.efi
+3
View File
@@ -1,3 +1,6 @@
# Godot 4.2+ specific ignores
~*.dll
# Godot 4+ specific ignores # Godot 4+ specific ignores
.godot/ .godot/
.nomedia .nomedia
+1 -1
View File
@@ -8,7 +8,7 @@ gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar !gradle-wrapper.jar
# Avoid ignore Gradle wrappper properties # Avoid ignore Gradle wrapper properties
!gradle-wrapper.properties !gradle-wrapper.properties
# Cache of project # Cache of project
+70 -35
View File
@@ -5,46 +5,81 @@
# Official AMD ROCm HIP .gitignore: https://github.com/ROCm/hip/blob/amd-staging/.gitignore # Official AMD ROCm HIP .gitignore: https://github.com/ROCm/hip/blob/amd-staging/.gitignore
# 1. Build directories and files # 1. Build directories and files
/build/ # common build directory # common build directory
/CMakeFiles/ # CMake internal files /build/
/CMakeCache.txt # CMake cache file # CMake internal files
/Makefile # autogenerated Makefile /CMakeFiles/
/cmake_install.cmake # install script # CMake cache file
/install_manifest.txt # install manifest list /CMakeCache.txt
*.ninja-dep # Ninja dependency files # autogenerated Makefile
*.ninja_log # Ninja log files /Makefile
meson-logs/ # Meson log directory # install script
/cmake_install.cmake
# install manifest list
/install_manifest.txt
# Ninja dependency files
*.ninja-dep
# Ninja log files
*.ninja_log
# Meson log directory
meson-logs/
# 2. Compilation outputs and intermediates # 2. Compilation outputs and intermediates
*.o # object files # object files
*.obj # Windows object files *.o
*.so # shared libraries # Windows object files
*.a # static librarie *.obj
*.d # dependency files # shared libraries
*.gch # precompiled headers *.so
*.ii # preprocessed output # static librarie
*.ii.cpp # C++ preprocessed output *.a
*.out # generic executable outputs # dependency files
*.exe # Windows executables *.d
# precompiled headers
*.gch
# preprocessed output
*.ii
# C++ preprocessed output
*.ii.cpp
# generic executable outputs
*.out
# Windows executables
*.exe
# 3. HIP/ROCm specific binaries and intermediates # 3. HIP/ROCm specific binaries and intermediates
*.hsaco # ROCm compiled binary # ROCm compiled binary
*.s # assembly output *.hsaco
*.kernels.cpp # autogenerated kernel sources # assembly output
*.hip.cpp.* # hipcc intermediate outputs *.s
# autogenerated kernel sources
*.kernels.cpp
# hipcc intermediate outputs
*.hip.cpp.*
# 4. Official sample binaries and tutorial outputs # 4. Official sample binaries and tutorial outputs
bin/hipInfo # sample binary # sample binary
bin/hipBusBandwidth # sample binary bin/hipInfo
bin/hipDispatchLatency # sample binary # sample binary
bin/hipify-clang # sample tool bin/hipBusBandwidth
samples/**/*.out # tutorial outputs # sample binary
samples/**/*.code # ISA/code dumps bin/hipDispatchLatency
samples/**/*.hsaco # compiled binaries # sample tool
samples/**/*.co # kernel code outputs bin/hipify-clang
# tutorial outputs
samples/**/*.out
# ISA/code dumps
samples/**/*.code
# compiled binaries
samples/**/*.hsaco
# kernel code outputs
samples/**/*.co
# 5. Tags, logs and test outputs # 5. Tags, logs and test outputs
tags # ctags index # ctags index
*.log # log files tags
/tests_output/ # custom test output directory # log files
/samples_output/ # custom sample output directory *.log
# custom test output directory
/tests_output/
# custom sample output directory
/samples_output/
+3
View File
@@ -36,5 +36,8 @@ fp-info-cache
# Archived Backups (KiCad 6.0) # Archived Backups (KiCad 6.0)
**/*-backups/*.zip **/*-backups/*.zip
# Local git-based history (KiCad 9.0+)
.history
# Local project settings # Local project settings
*.kicad_prl *.kicad_prl
+1
View File
@@ -21,6 +21,7 @@ Homestead.yaml
Homestead.json Homestead.json
/.vagrant /.vagrant
.phpunit.result.cache .phpunit.result.cache
/.phpunit.cache
/public/build /public/build
/storage/pail /storage/pail
+47
View File
@@ -0,0 +1,47 @@
## LASAL ###
# website: https://www.sigmatek-automation.com/en/products/engineering-tool-lasal/
# lasal screen/visu runtime folders generated during build
**/Runtime
**/BAK
**/Language
**/TempPreview
# lasal class runtime folders generated during build
ProjectInternal
Internal
**/Network/*/*.st
**/Drive/*.st
# bootdisk files
**/Bootdisk
# various filetypes generated at runtime or used for internal backups
*.ldi
*.bak
*.lob
*.lba
*.lcb
*.lock
*.plc
*.7z
*.zip
*.lcc
*.lds
# tag files generated by the compiler
*.mme
**/MaeExp.txt
**/MaeExp.xml
# SigCLib requires lba and lob files
!cObjLib.lob
!cObjLib.lba
# opc related classes added automatically from lasal instance
!**/Class/OPC_UA/**
!**/Class/OPC_UA_Client/**
!**/Class/OPC_UA_Server/**
!**/Class/OPC_UA_ModuleBase/**
!**/Class/OPC_UA_AddressSpace/**
!**/Class/OPC_UA_OpenSSL_v1_1_1/**
+53
View File
@@ -0,0 +1,53 @@
# Build System Artifacts
# MoonBit default build output directory.
_build/
# Local MoonBit package cache directory.
.mooncakes/
# Coverage and Test Artifacts
# Coverage reports generated by MoonBit tooling.
moonbit-coverage-*.txt
# Coverage output directory used by coverage commands.
_coverage/
# Bisect runtime coverage data file.
bisect.coverage
# JavaScript Target Artifacts
# Uncomment if generated JavaScript should be ignored.
# *.js
# Source map files generated for JavaScript output.
*.js.map
# Node.js dependencies used in JS target workflows.
node_modules/
# WebAssembly Target Artifacts
# Compiled WebAssembly binaries.
*.wasm
# WebAssembly text format output.
*.wat
# MoonBit Pilot / Agent Artifacts
# MoonBit agent runtime state and temporary files.
.moonagent/
# LLVM Backend Artifacts
# LLVM textual intermediate representation (IR) files.
*.ll
# LLVM bitcode files.
*.bc
# Native object files from LLVM/native compilation.
*.o
# Generated assembly source files.
*.s
# Default executable output name on Unix-like systems.
*.out
# Native executable output on Windows.
*.exe
# macOS debug symbol bundles.
*.dSYM/
+6 -2
View File
@@ -47,6 +47,7 @@ nosetests.xml
coverage.xml coverage.xml
*.cover *.cover
*.py.cover *.py.cover
*.lcov
.hypothesis/ .hypothesis/
.pytest_cache/ .pytest_cache/
cover/ cover/
@@ -122,13 +123,14 @@ ipython_config.py
# pixi.lock # pixi.lock
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
# in the .venv directory. It is recommended not to include this directory in version control. # in the .venv directory. It is recommended not to include this directory in version control.
.pixi .pixi/*
!.pixi/config.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/ __pypackages__/
# Celery stuff # Celery stuff
celerybeat-schedule celerybeat-schedule*
celerybeat.pid celerybeat.pid
# Redis # Redis
@@ -200,6 +202,8 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. However, if you prefer, # and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder # you could uncomment the following to ignore the entire vscode folder
# .vscode/ # .vscode/
# Temporary file for partial code execution
tempCodeRunnerFile.py
# Ruff stuff: # Ruff stuff:
.ruff_cache/ .ruff_cache/
+2
View File
@@ -29,8 +29,10 @@ ui_*.h
*.jsc *.jsc
Makefile* Makefile*
*build-* *build-*
build/
*.qm *.qm
*.prl *.prl
*.qmlls.ini
# Qt unit tests # Qt unit tests
target_wrapper.* target_wrapper.*
+2 -2
View File
@@ -30,7 +30,7 @@ We support a collection of templates, organized in this way:
or merge these rules into your project-specific templates if you want to use or merge these rules into your project-specific templates if you want to use
them permanently. them permanently.
- [`community`](./community) contains specialized templates for other popular - [`community`](./community) contains specialized templates for other popular
languages, tools and project, which don't currently belong in the mainstream languages, tools, and projects that don't currently belong in the mainstream
templates. These should be added to your project-specific templates when you templates. These should be added to your project-specific templates when you
decide to adopt the framework or tool. decide to adopt the framework or tool.
@@ -53,7 +53,7 @@ If you have a small set of rules, or want to support a technology that is not
widely in use, and still believe this will be helpful to others, please read the widely in use, and still believe this will be helpful to others, please read the
section about [specialized templates](#specialized-templates) for more details. section about [specialized templates](#specialized-templates) for more details.
Include details when opening pull request if the template is important and visible. We Include details when opening a pull request if the template is important and visible. We
may not accept it immediately, but we can promote it to the root at a later date may not accept it immediately, but we can promote it to the root at a later date
based on interest. based on interest.
+3
View File
@@ -13,6 +13,9 @@ target
# Contains mutation testing data # Contains mutation testing data
**/mutants.out*/ **/mutants.out*/
# rustc will dump stack traces when hitting an internal compiler error to PWD
rustc-ice-*.txt
# RustRover # RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+20
View File
@@ -0,0 +1,20 @@
# gitignore file for a SolidWorks project
# SolidWorks temporary files
~$*.sldprt
~$*.sldasm
~$*.slddrw
~$*.sld
# For systems with case-sensitive (SolidWorks uses both)
~$*.SLDPRT
~$*.SLDASM
~$*.SLDDRW
~$*.SLD
# SolidWorks backups and auto-recovery
*.bak
*.swbak
# Cache of simulation results
/simulation_results/
+7
View File
@@ -2,6 +2,9 @@
# #
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
# #
# Recommended: add any editor/OS/tool-specific ignore rules from the Global/ templates as needed.
# See: https://github.com/github/gitignore/tree/main/Global
#
.utmp/ .utmp/
/[Ll]ibrary/ /[Ll]ibrary/
/[Tt]emp/ /[Tt]emp/
@@ -43,6 +46,7 @@ ExportedObj/
*.csproj *.csproj
*.unityproj *.unityproj
*.sln *.sln
*.slnx
*.suo *.suo
*.tmp *.tmp
*.user *.user
@@ -97,3 +101,6 @@ InitTestScene*.unity*
# Auto-generated scenes by play mode tests # Auto-generated scenes by play mode tests
/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity* /[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity*
# Auto-generated cache in Assets folder
/[Aa]ssets/[Ss]ceneDependencyCache*
+1
View File
@@ -86,6 +86,7 @@ BenchmarkDotNet.Artifacts/
project.lock.json project.lock.json
project.fragment.lock.json project.fragment.lock.json
artifacts/ artifacts/
.artifacts/
# ASP.NET Scaffolding # ASP.NET Scaffolding
ScaffoldingReadMe.txt ScaffoldingReadMe.txt
+2 -2
View File
@@ -1,4 +1,4 @@
# Wordpress - ignore core, configuration, examples, uploads and logs. # WordPress - ignore core, configuration, examples, uploads and logs.
# https://github.com/github/gitignore/blob/main/WordPress.gitignore # https://github.com/github/gitignore/blob/main/WordPress.gitignore
# Core # Core
@@ -45,4 +45,4 @@ wp-config.php
# #
# Note: If you wish to whitelist themes, # Note: If you wish to whitelist themes,
# uncomment the next line # uncomment the next line
#/wp-content/themes #/wp-content/themes
+113
View File
@@ -0,0 +1,113 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# database
*.sqlite
# package-json
package-json.lock
# bun deploy file
node_modules.bun
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
+27
View File
@@ -0,0 +1,27 @@
# Zephyr RTOS build artifacts
/build/
/twister-out*/
# Generated configuration files
*.config
*.config.old
/zephyr/.config
# Device tree generated files
*.dts.pre.tmp
*.dts_compiled
# Kconfig generated
autoconf.h
# West workspace
/.west/
# Python virtual environment
/.venv/
/venv/
# IDE
.vscode/launch.json
.vscode/tasks.json
*.jlink
+5
View File
@@ -0,0 +1,5 @@
# FreeCAD backup and temporary files
*.FC.lock
*.bak
*.FCBak
*.tmp
+11
View File
@@ -0,0 +1,11 @@
*Script
# Holmake generated files
*Theory.sig
*Theory.sml
*.uo
*.ui
# Holmake auxiliary files
.hollogs
.HOLMK
+14 -7
View File
@@ -11,15 +11,22 @@
node_modules/ node_modules/
# Expo local state and caches # Expo local state and caches
.expo/ # runtime state (Metro bundler, dev-client data, tunnels) # runtime state (Metro bundler, dev-client data, tunnels)
.expo-shared/ # shared project settings (app.json edits, etc.) .expo/
# shared project settings (app.json edits, etc.)
.expo-shared/
# Metro bundler caches/logs # Metro bundler caches/logs
*.expo # generic Expo temp files # generic Expo temp files
*.tunnel # Expo DevTools tunnels *.expo
*.cache # Metro cache folder # Expo DevTools tunnels
*.tmp # temp files created during bundling *.tunnel
*.log # build or Metro logs # Metro cache folder
*.cache
# temp files created during bundling
*.tmp
# build or Metro logs
*.log
# Environment variables # Environment variables
.env .env
+41 -21
View File
@@ -4,27 +4,38 @@
# Compiled MQL5 executables (binaries) # Compiled MQL5 executables (binaries)
# These are generated from .mq5 source files and should not be committed. # These are generated from .mq5 source files and should not be committed.
*.ex5 *.ex5
*.ex4 # For MQL4 compatibility if you also manage MT4 projects in a similar structure # For MQL4 compatibility if you also manage MT4 projects in a similar structure
*.ex4
# Log files # Log files
# Terminal logs, strategy tester logs, and custom logs from Print() functions. # Terminal logs, strategy tester logs, and custom logs from Print() functions.
*.log *.log
*.slog # Strategy Tester logs # Strategy Tester logs
*.slog
# Strategy Tester specific files # Strategy Tester specific files
# History data, optimization results, and temporary files used by the tester. # History data, optimization results, and temporary files used by the tester.
*.fxt # FXT files (history data for testing) # FXT files (history data for testing)
*.hst # History data files (can be large) *.fxt
*.ini # Initialization files (often generated by tester or EAs) # History data files (can be large)
*.dat # Data files (various purposes, often temporary) *.hst
*.csv # CSV export files (e.g., from tester reports) # Initialization files (often generated by tester or EAs)
*.jrn # Journal files (tester journal) *.ini
# Data files (various purposes, often temporary)
*.dat
# CSV export files (e.g., from tester reports)
*.csv
# Journal files (tester journal)
*.jrn
# Market Watch sets and profiles # Market Watch sets and profiles
# User-specific lists of symbols in Market Watch, and terminal profiles. # User-specific lists of symbols in Market Watch, and terminal profiles.
*.set # Market Watch symbol sets # Market Watch symbol sets
*.tpl # Chart templates *.set
*.chr # Chart settings files (can be generated when saving templates or profiles) # Chart templates
*.tpl
# Chart settings files (can be generated when saving templates or profiles)
*.chr
# External libraries (DLLs) # External libraries (DLLs)
# If you use custom DLLs, you might want to ignore them if they are built separately # If you use custom DLLs, you might want to ignore them if they are built separately
@@ -33,14 +44,19 @@
# User-specific configuration and credentials # User-specific configuration and credentials
# Files containing sensitive information or local user settings. # Files containing sensitive information or local user settings.
.env # Environment variables (e.g., for Python integration credentials) # Environment variables (e.g., for Python integration credentials)
*.cfg # Configuration files (if not meant to be shared) .env
*.json # Be careful: if you have config JSONs you *do* want to commit, add specific exceptions. # Configuration files (if not meant to be shared)
# Example: !config.json (to include config.json but ignore other *.json) *.cfg
# Be careful: if you have config JSONs you *do* want to commit, add specific exceptions.
*.json
# Example: !config.json (to include config.json but ignore other *.json)
# Temporary files and backup files generated by MetaEditor # Temporary files and backup files generated by MetaEditor
*.~* # Temporary files (e.g., ~MyScript.mq5) # Temporary files (e.g., ~MyScript.mq5)
*.bak # Backup files (e.g., MyScript.mq5.bak) *.~*
# Backup files (e.g., MyScript.mq5.bak)
*.bak
*.mqh.bak *.mqh.bak
*.mq5.bak *.mq5.bak
@@ -51,7 +67,11 @@
# Python specific ignores (if you also keep Python scripts or Jupyter notebooks in this repository) # Python specific ignores (if you also keep Python scripts or Jupyter notebooks in this repository)
# These are relevant if your Git repo root is higher up (e.g., the terminal folder itself) # These are relevant if your Git repo root is higher up (e.g., the terminal folder itself)
# or if you mix Python code within your MQL5 structure. # or if you mix Python code within your MQL5 structure.
__pycache__/ # Python compiled bytecode cache # Python compiled bytecode cache
.ipynb_checkpoints/ # Jupyter Notebook checkpoints __pycache__/
*.pyc # Python compiled files # Jupyter Notebook checkpoints
*.pyd # Python dynamic modules .ipynb_checkpoints/
# Python compiled files
*.pyc
# Python dynamic modules
*.pyd
+12
View File
@@ -0,0 +1,12 @@
# Tauri
# https://tauri.app/
#
# Recommended: Rust.gitignore
# Rust compilation output
# https://doc.rust-lang.org/cargo/guide/build-cache.html
target/
# WiX Toolset cache (Windows MSI installer builds)
# https://v2.tauri.app/distribute/windows-installer/
WixTools/
+78
View File
@@ -0,0 +1,78 @@
#!/usr/bin/env python3
"""
Strip trailing whitespace from .gitignore template files.
This script fixes trailing whitespace issues in gitignore templates,
which can cause unexpected behavior in pattern matching.
"""
import argparse
import os
import sys
def strip_file(filepath: str, dry_run: bool = False) -> int:
"""Strip trailing whitespace from a file. Returns number of lines fixed."""
with open(filepath, "r", encoding="utf-8", errors="replace") as f:
lines = f.readlines()
fixed_count = 0
new_lines = []
for line in lines:
stripped = line.rstrip() + "\n"
if stripped != line:
fixed_count += 1
new_lines.append(stripped)
# Ensure file ends with a single newline
if new_lines and new_lines[-1] == "\n":
pass # already ends properly
elif not new_lines:
new_lines = ["\n"]
if fixed_count > 0 and not dry_run:
with open(filepath, "w", encoding="utf-8", newline="") as f:
f.writelines(new_lines)
return fixed_count
def main():
parser = argparse.ArgumentParser(
description="Strip trailing whitespace from .gitignore templates."
)
parser.add_argument("files", nargs="*", help="Files to process.")
parser.add_argument("--repo-root", default=".", help="Repo root directory.")
parser.add_argument(
"--dry-run", action="store_true", help="Report but do not modify files."
)
args = parser.parse_args()
if args.files:
targets = args.files
else:
targets = []
for entry in os.listdir(args.repo_root):
full = os.path.join(args.repo_root, entry)
if os.path.isfile(full) and entry.endswith(".gitignore"):
targets.append(full)
total_fixed = 0
for filepath in targets:
count = strip_file(filepath, dry_run=args.dry_run)
if count > 0:
action = "would fix" if args.dry_run else "fixed"
print(f" {action} {count} line(s) in {filepath}")
total_fixed += count
if total_fixed == 0:
print("No trailing whitespace found.")
else:
action = "Would fix" if args.dry_run else "Fixed"
print(f"\n{action} {total_fixed} line(s) total.")
sys.exit(0)
if __name__ == "__main__":
main()
+189
View File
@@ -0,0 +1,189 @@
#!/usr/bin/env python3
"""Tests for the gitignore template validator."""
import os
import tempfile
import pytest
from validate_templates import (
Issue,
Severity,
ValidationReport,
analyze_coverage,
check_trailing_whitespace,
discover_templates,
find_conflicts,
find_duplicates,
format_report,
is_valid_glob_pattern,
validate_template,
)
class TestIsValidGlobPattern:
def test_simple_extension(self):
assert is_valid_glob_pattern("*.py") is True
def test_directory_pattern(self):
assert is_valid_glob_pattern("build/") is True
def test_negation(self):
assert is_valid_glob_pattern("!important.txt") is True
def test_double_star(self):
assert is_valid_glob_pattern("**/logs") is True
def test_bracket_pattern(self):
assert is_valid_glob_pattern("*.[oa]") is True
def test_unmatched_bracket(self):
assert is_valid_glob_pattern("*.[o") is False
def test_empty_after_strip(self):
assert is_valid_glob_pattern("!") is False
def test_rooted_pattern(self):
assert is_valid_glob_pattern("/build") is True
class TestCheckTrailingWhitespace:
def test_no_trailing(self):
assert check_trailing_whitespace("*.py", 1) is None
def test_with_trailing_space(self):
issue = check_trailing_whitespace("*.py ", 5)
assert issue is not None
assert issue.severity == Severity.WARNING
assert issue.line_number == 5
def test_blank_line_ignored(self):
assert check_trailing_whitespace(" ", 1) is None
class TestFindDuplicates:
def test_no_duplicates(self):
patterns = [(1, "*.py"), (2, "*.js"), (3, "build/")]
assert find_duplicates(patterns) == []
def test_exact_duplicate(self):
patterns = [(1, "*.py"), (2, "*.js"), (3, "*.py")]
issues = find_duplicates(patterns)
assert len(issues) == 1
assert issues[0].line_number == 3
def test_trailing_slash_normalization(self):
patterns = [(1, "build"), (2, "build/")]
issues = find_duplicates(patterns)
assert len(issues) == 1
class TestFindConflicts:
def test_no_conflicts(self):
patterns = [(1, "*.log"), (2, "*.tmp")]
assert find_conflicts(patterns) == []
def test_include_then_negate(self):
patterns = [(1, "*.log"), (2, "!*.log")]
issues = find_conflicts(patterns)
assert len(issues) == 1
assert issues[0].severity == Severity.WARNING
def test_negate_without_include(self):
patterns = [(1, "!important.txt")]
issues = find_conflicts(patterns)
assert len(issues) == 0
class TestAnalyzeCoverage:
def test_many_wildcards(self):
patterns = [(i, f"*.ext{i}") for i in range(12)]
issues = analyze_coverage(patterns)
msgs = [i.message for i in issues]
assert any("wildcard" in m for m in msgs)
def test_no_directory_patterns(self):
patterns = [(i, f"*.ext{i}") for i in range(6)]
issues = analyze_coverage(patterns)
msgs = [i.message for i in issues]
assert any("directory" in m.lower() for m in msgs)
def test_duplicate_extension_suggestion(self):
patterns = [(1, "*.py"), (2, "*.py")]
issues = analyze_coverage(patterns)
msgs = [i.message for i in issues]
assert any(".py" in m for m in msgs)
class TestValidateTemplate:
def test_valid_template(self):
with tempfile.NamedTemporaryFile(
mode="w", suffix=".gitignore", delete=False
) as f:
f.write("# Build output\nbuild/\n*.o\n*.a\n")
f.flush()
report = validate_template(f.name)
os.unlink(f.name)
assert report.error_count == 0
assert report.pattern_count == 3
assert report.comment_count == 1
def test_invalid_pattern(self):
with tempfile.NamedTemporaryFile(
mode="w", suffix=".gitignore", delete=False
) as f:
f.write("*.[invalid\n")
f.flush()
report = validate_template(f.name)
os.unlink(f.name)
assert report.error_count > 0
def test_file_not_found(self):
report = validate_template("/nonexistent/file.gitignore")
assert report.error_count > 0
class TestFormatReport:
def test_clean_report(self):
report = ValidationReport(
template_file="test.gitignore",
total_lines=5,
pattern_count=3,
comment_count=1,
blank_count=1,
)
output = format_report(report)
assert "No issues found" in output
def test_report_with_issues(self):
report = ValidationReport(
template_file="test.gitignore",
total_lines=5,
pattern_count=3,
)
report.issues.append(
Issue(
severity=Severity.ERROR,
line_number=2,
line_content="*.[bad",
message="Invalid glob pattern",
)
)
output = format_report(report, verbose=True)
assert "ERROR" in output
assert "*.[bad" in output
class TestDiscoverTemplates:
def test_discover_in_directory(self):
with tempfile.TemporaryDirectory() as tmpdir:
# Create fake gitignore files
for name in ["Python.gitignore", "Java.gitignore", "README.md"]:
with open(os.path.join(tmpdir, name), "w") as f:
f.write("# test\n")
templates = discover_templates(tmpdir)
assert len(templates) == 2
assert all(t.endswith(".gitignore") for t in templates)
if __name__ == "__main__":
pytest.main([__file__, "-v"])
+433
View File
@@ -0,0 +1,433 @@
#!/usr/bin/env python3
"""
Gitignore Template Validator
Validates .gitignore template files for syntax correctness, duplicate patterns,
conflicting rules, and provides coverage analysis with detailed reporting.
"""
import argparse
import fnmatch
import os
import re
import sys
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
from typing import List, Optional
class Severity(Enum):
ERROR = "ERROR"
WARNING = "WARNING"
SUGGESTION = "SUGGESTION"
@dataclass
class Issue:
severity: Severity
line_number: int
line_content: str
message: str
template_file: str = ""
@dataclass
class ValidationReport:
template_file: str
total_lines: int = 0
pattern_count: int = 0
comment_count: int = 0
blank_count: int = 0
issues: List[Issue] = field(default_factory=list)
@property
def error_count(self) -> int:
return sum(1 for i in self.issues if i.severity == Severity.ERROR)
@property
def warning_count(self) -> int:
return sum(1 for i in self.issues if i.severity == Severity.WARNING)
@property
def suggestion_count(self) -> int:
return sum(1 for i in self.issues if i.severity == Severity.SUGGESTION)
@property
def has_errors(self) -> bool:
return self.error_count > 0
def is_valid_glob_pattern(pattern: str) -> bool:
"""Check if a pattern is a valid glob/gitignore pattern."""
clean = pattern.lstrip("!")
if clean.startswith("/"):
clean = clean[1:]
if clean.endswith("/"):
clean = clean[:-1]
if not clean:
return False
try:
# Check for unmatched brackets
bracket_depth = 0
i = 0
while i < len(clean):
ch = clean[i]
if ch == "\\" and i + 1 < len(clean):
i += 2
continue
if ch == "[":
bracket_depth += 1
elif ch == "]":
if bracket_depth > 0:
bracket_depth -= 1
else:
return False
i += 1
if bracket_depth != 0:
return False
# Test compile the pattern via fnmatch
fnmatch.translate(clean)
return True
except Exception:
return False
def check_trailing_whitespace(line: str, line_number: int) -> Optional[Issue]:
"""Detect trailing whitespace on a line."""
if line != line.rstrip() and line.strip():
return Issue(
severity=Severity.WARNING,
line_number=line_number,
line_content=line,
message="Line has trailing whitespace",
)
return None
def find_duplicates(patterns: List[tuple]) -> List[Issue]:
"""Find duplicate patterns in the list."""
issues = []
seen = {}
for line_num, pattern in patterns:
normalized = pattern.strip().rstrip("/")
if normalized in seen:
issues.append(
Issue(
severity=Severity.WARNING,
line_number=line_num,
line_content=pattern,
message=f"Duplicate pattern (first seen at line {seen[normalized]})",
)
)
else:
seen[normalized] = line_num
return issues
def find_conflicts(patterns: List[tuple]) -> List[Issue]:
"""Find conflicting include/exclude rules for the same pattern."""
issues = []
include_patterns = {}
exclude_patterns = {}
for line_num, pattern in patterns:
stripped = pattern.strip()
if stripped.startswith("!"):
base = stripped[1:].strip().rstrip("/")
exclude_patterns[base] = line_num
if base in include_patterns:
issues.append(
Issue(
severity=Severity.WARNING,
line_number=line_num,
line_content=stripped,
message=(
f"Negation pattern conflicts with include at line "
f"{include_patterns[base]}. Order matters in gitignore."
),
)
)
else:
base = stripped.rstrip("/")
include_patterns[base] = line_num
return issues
def analyze_coverage(patterns: List[tuple]) -> List[Issue]:
"""Analyze pattern coverage and suggest improvements."""
issues = []
wildcard_count = 0
extension_patterns = []
directory_patterns = []
for line_num, pattern in patterns:
stripped = pattern.strip().lstrip("!")
if stripped.startswith("*"):
wildcard_count += 1
if re.match(r"^\*\.[a-zA-Z0-9]+$", stripped):
extension_patterns.append((line_num, stripped))
if stripped.endswith("/"):
directory_patterns.append((line_num, stripped))
if wildcard_count > 10:
issues.append(
Issue(
severity=Severity.SUGGESTION,
line_number=0,
line_content="",
message=(
f"Template has {wildcard_count} wildcard patterns. "
"Consider grouping related patterns with comments."
),
)
)
ext_groups = {}
for line_num, pat in extension_patterns:
ext = pat.split(".")[-1].lower()
ext_groups.setdefault(ext, []).append(line_num)
for ext, lines in ext_groups.items():
if len(lines) > 1:
issues.append(
Issue(
severity=Severity.SUGGESTION,
line_number=lines[1],
line_content="",
message=(
f"Multiple patterns target .{ext} files "
f"(lines {', '.join(map(str, lines))}). Consider consolidating."
),
)
)
if not directory_patterns and len(patterns) > 5:
issues.append(
Issue(
severity=Severity.SUGGESTION,
line_number=0,
line_content="",
message=(
"No directory-specific patterns found. "
"Consider adding directory ignores (e.g., build/)."
),
)
)
return issues
def validate_template(filepath: str) -> ValidationReport:
"""Validate a single gitignore template file."""
report = ValidationReport(template_file=filepath)
try:
with open(filepath, "r", encoding="utf-8", errors="replace") as f:
lines = f.readlines()
except OSError as e:
report.issues.append(
Issue(
severity=Severity.ERROR,
line_number=0,
line_content="",
message=f"Cannot read file: {e}",
template_file=filepath,
)
)
return report
report.total_lines = len(lines)
patterns = []
for i, raw_line in enumerate(lines, start=1):
line = raw_line.rstrip("\n\r")
# Check trailing whitespace
ws_issue = check_trailing_whitespace(line, i)
if ws_issue:
ws_issue.template_file = filepath
report.issues.append(ws_issue)
stripped = line.strip()
# Blank line
if not stripped:
report.blank_count += 1
continue
# Comment
if stripped.startswith("#"):
report.comment_count += 1
continue
# Pattern line
report.pattern_count += 1
patterns.append((i, stripped))
# Validate glob syntax
if not is_valid_glob_pattern(stripped):
report.issues.append(
Issue(
severity=Severity.ERROR,
line_number=i,
line_content=stripped,
message="Invalid glob pattern syntax",
template_file=filepath,
)
)
# Check for spaces in patterns (usually a mistake)
if " " in stripped and not stripped.startswith("\\"):
report.issues.append(
Issue(
severity=Severity.WARNING,
line_number=i,
line_content=stripped,
message="Pattern contains spaces — this may be unintentional",
template_file=filepath,
)
)
# Run duplicate detection
dup_issues = find_duplicates(patterns)
for issue in dup_issues:
issue.template_file = filepath
report.issues.extend(dup_issues)
# Run conflict detection
conflict_issues = find_conflicts(patterns)
for issue in conflict_issues:
issue.template_file = filepath
report.issues.extend(conflict_issues)
# Run coverage analysis
coverage_issues = analyze_coverage(patterns)
for issue in coverage_issues:
issue.template_file = filepath
report.issues.extend(coverage_issues)
return report
def format_report(report: ValidationReport, verbose: bool = False) -> str:
"""Format a validation report as human-readable text."""
lines = []
lines.append(f"\n{'='*60}")
lines.append(f"File: {report.template_file}")
lines.append(f"{'='*60}")
lines.append(
f" Lines: {report.total_lines} | Patterns: {report.pattern_count} "
f"| Comments: {report.comment_count} | Blank: {report.blank_count}"
)
lines.append(
f" Errors: {report.error_count} | Warnings: {report.warning_count} "
f"| Suggestions: {report.suggestion_count}"
)
if report.issues:
lines.append("")
for issue in sorted(report.issues, key=lambda x: (x.severity.value, x.line_number)):
prefix = f" [{issue.severity.value}]"
loc = f" Line {issue.line_number}:" if issue.line_number > 0 else ""
lines.append(f"{prefix}{loc} {issue.message}")
if verbose and issue.line_content:
lines.append(f" > {issue.line_content}")
else:
lines.append(" No issues found. ✓")
return "\n".join(lines)
def discover_templates(repo_root: str) -> List[str]:
"""Discover all .gitignore template files in the repository."""
templates = []
for entry in os.listdir(repo_root):
full_path = os.path.join(repo_root, entry)
if os.path.isfile(full_path) and entry.endswith(".gitignore"):
templates.append(full_path)
# Also check Global/ and community/ subdirectories
for subdir in ["Global", "community"]:
subdir_path = os.path.join(repo_root, subdir)
if os.path.isdir(subdir_path):
for entry in os.listdir(subdir_path):
full_path = os.path.join(subdir_path, entry)
if os.path.isfile(full_path) and entry.endswith(".gitignore"):
templates.append(full_path)
return sorted(templates)
def main():
parser = argparse.ArgumentParser(
description="Validate .gitignore template files for common issues."
)
parser.add_argument(
"files",
nargs="*",
help="Template files to validate. If none given, validates all in repo.",
)
parser.add_argument(
"--repo-root",
default=".",
help="Root directory of the gitignore repo (default: current directory).",
)
parser.add_argument(
"--verbose", "-v",
action="store_true",
help="Show pattern content alongside issues.",
)
parser.add_argument(
"--errors-only",
action="store_true",
help="Only report errors, not warnings or suggestions.",
)
parser.add_argument(
"--summary",
action="store_true",
help="Print only a summary, not per-file details.",
)
args = parser.parse_args()
if args.files:
templates = args.files
else:
templates = discover_templates(args.repo_root)
if not templates:
print("No .gitignore templates found.")
sys.exit(0)
reports = []
for tpl in templates:
report = validate_template(tpl)
reports.append(report)
total_errors = 0
total_warnings = 0
total_suggestions = 0
for report in reports:
if args.errors_only:
report.issues = [i for i in report.issues if i.severity == Severity.ERROR]
if not args.summary:
print(format_report(report, verbose=args.verbose))
total_errors += report.error_count
total_warnings += report.warning_count
total_suggestions += report.suggestion_count
print(f"\n{'='*60}")
print(f"SUMMARY: {len(reports)} templates validated")
print(f" Total errors: {total_errors}")
print(f" Total warnings: {total_warnings}")
print(f" Total suggestions: {total_suggestions}")
print(f"{'='*60}")
if total_errors > 0:
sys.exit(1)
sys.exit(0)
if __name__ == "__main__":
main()