This is an automated email from the ASF dual-hosted git repository.
hussein-awala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new ddb02d81b26 Remove unused Breeze snippet helpers (#75854)
ddb02d81b26 is described below
commit ddb02d81b269c718ea8ad2b078d2d0d687c838f8
Author: Hussein Awala <[email protected]>
AuthorDate: Wed Oct 28 13:57:58 2026 +0100
Remove unused Breeze snippet helpers (#75854)
---
.../airflow_breeze/utils/publish_docs_helpers.py | 32 ----------------------
1 file changed, 32 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
b/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
index e3f4265e760..e81cb321daf 100644
--- a/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
+++ b/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
@@ -18,7 +18,6 @@
from __future__ import annotations
import os
-from pathlib import Path
from airflow_breeze.utils.path_utils import (
AIRFLOW_ROOT_PATH,
@@ -29,40 +28,9 @@ CONSOLE_WIDTH = 180
PROVIDER_DATA_SCHEMA_PATH = AIRFLOW_ROOT_PATH / "airflow" /
"provider.yaml.schema.json"
-def _filepath_to_module(filepath: str):
- return str(Path(filepath).relative_to(AIRFLOW_ROOT_PATH)).replace("/", ".")
-
-
def pretty_format_path(path: str, start: str) -> str:
"""Formats path nicely."""
relpath = os.path.relpath(path, start)
if relpath == path:
return path
return f"{start}/{relpath}"
-
-
-def prepare_code_snippet(file_path: str, line_no: int, context_lines_count:
int = 5) -> str:
- """
- Prepare code snippet with line numbers and a specific line marked.
-
- :param file_path: File name
- :param line_no: Line number
- :param context_lines_count: The number of lines that will be cut before
and after.
- :return: str
- """
- with open(file_path) as text_file:
- # Highlight code
- code = text_file.read()
- code_lines = code.splitlines()
- # Prepend line number
- code_lines = [
- f">{lno:3} | {line}" if line_no == lno else f"{lno:4} | {line}"
- for lno, line in enumerate(code_lines, 1)
- ]
- # # Cut out the snippet
- start_line_no = max(0, line_no - context_lines_count - 1)
- end_line_no = line_no + context_lines_count
- code_lines = code_lines[start_line_no:end_line_no]
- # Join lines
- code = "\n".join(code_lines)
- return code