-
Notifications
You must be signed in to change notification settings - Fork 0
Fix conflict-marker lint false positives #68
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
Changes from all commits
2b8d112
d48169c
82965c8
3bf856e
1739616
f368c46
47ca711
4563782
508a395
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Reduce context size for GitHub Copilot (including coding agent runs) | ||
| # Keep this focused on generated, vendored, or binary-heavy paths. | ||
|
|
||
| # Python caches / local envs | ||
| __pycache__/ | ||
| .mypy_cache/ | ||
| .pytest_cache/ | ||
| .ruff_cache/ | ||
| .venv/ | ||
| .venv*/ | ||
|
|
||
| # Coverage / build artifacts | ||
| htmlcov/ | ||
| .coverage* | ||
| coverage.xml | ||
| build/ | ||
| dist/ | ||
|
|
||
| # Node vendored deps | ||
| node_modules/ | ||
|
|
||
| # Large binaries | ||
| *.vsix | ||
| *.zip | ||
| *.7z | ||
| *.tar | ||
| *.gz | ||
|
|
||
| # Data artifacts (keep templates/docs tracked elsewhere) | ||
| data/bronze/ | ||
| data/silver/ | ||
| data/gold/ | ||
| data/analytics/ | ||
| data/manual/raw_downloads/ | ||
| data/manual/processed/ | ||
| data/manual/outputs/ | ||
|
|
||
| # Large generated artifacts | ||
| stress_artifacts/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,9 @@ jobs: | |
| import pathlib | ||
| import sys | ||
|
|
||
| markers = ("<<<<<<<", "=======", ">>>>>>>") | ||
| # Only flag real git conflict marker lines. | ||
| # In particular, don't treat long doc separators like "=====" as conflicts. | ||
| START_MARKERS = ("<<<<<<<", ">>>>>>>", "|||||||") | ||
| matches: list[tuple[str, int, str]] = [] | ||
|
|
||
| allowed_suffixes = {".py", ".yml", ".yaml", ".md"} | ||
|
|
@@ -66,8 +68,9 @@ jobs: | |
| continue | ||
| for i, line in enumerate(text, start=1): | ||
| stripped = line.lstrip() | ||
| if stripped.startswith(markers): | ||
| matches.append((str(path), i, stripped.strip())) | ||
| cleaned = stripped.strip() | ||
| if cleaned.startswith(START_MARKERS) or cleaned == "=======": | ||
| matches.append((str(path), i, cleaned)) | ||
|
Comment on lines
+71
to
+73
|
||
|
|
||
| if matches: | ||
| print("Found git merge conflict markers in tracked sources:") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.1.6 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix, --exit-non-zero-on-fix] | ||
| - id: ruff-format |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
START_MARKERSis a bit misleading because it includes>>>>>>>(an end marker) and|||||||(ancestor marker). Consider renaming to something likeCONFLICT_MARKER_PREFIXES(or similar) to better reflect what the tuple contains.