Fix conflict-marker lint false positives#68
Conversation
…ing across the codebase
…ing across the codebase
There was a problem hiding this comment.
Pull request overview
Adjusts the merge-conflict-marker detection in the lint workflow to only flag actual git conflict markers, avoiding false positives on documentation separator lines.
Changes:
- Tightened conflict marker matching logic in the GitHub Actions lint workflow (prefix markers + exact
=======only). - Standardized UTC timestamp usage in the aggregator module via
timezone.utc. - Added developer tooling configs (
.pre-commit-config.yaml,.copilotignore).
Reviewed changes
Copilot reviewed 4 out of 2466 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| data_pipeline/anatel/acesso_fixo_aggregator.py | Switches UTC time acquisition to timezone.utc for timestamp/report generation. |
| .pre-commit-config.yaml | Adds Ruff + Ruff formatter pre-commit hooks. |
| .github/workflows/lint.yml | Refines conflict-marker detection to avoid false positives (doc separators). |
| .copilotignore | Excludes generated/binary-heavy paths from Copilot context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Only flag real git conflict marker lines. | ||
| # In particular, don't treat long doc separators like "=====" as conflicts. | ||
| START_MARKERS = ("<<<<<<<", ">>>>>>>", "|||||||") |
There was a problem hiding this comment.
START_MARKERS is a bit misleading because it includes >>>>>>> (an end marker) and ||||||| (ancestor marker). Consider renaming to something like CONFLICT_MARKER_PREFIXES (or similar) to better reflect what the tuple contains.
| cleaned = stripped.strip() | ||
| if cleaned.startswith(START_MARKERS) or cleaned == "=======": | ||
| matches.append((str(path), i, cleaned)) |
There was a problem hiding this comment.
The middle marker \"=======\" is currently a hard-coded string while the other markers are grouped in a constant. To make the intent clearer and avoid scattering marker definitions, consider defining a dedicated constant (or set) for exact-match markers (e.g., EXACT_MARKERS = {\"=======\"}) and using membership checks alongside the prefix tuple.
Fixes the GitHub Actions Lint workflow "Fail on merge conflict markers" step so it only matches real git conflict marker lines (
<<<<<<<,>>>>>>>,|||||||, or a line exactly=======), preventing false positives on documentation separator lines.This keeps the fail-fast guardrail while avoiding spurious CI failures.
Local verification:
Ruff (check)passesPytest (repo, quick)passes