MCPcopy Create free account
hub / github.com/apache/solr / __init__

Method __init__

dev-tools/scripts/validateChangelogs.py:73–115  ·  view source on GitHub ↗

Initialize the validator. Args: git_root: Root of git repository (auto-detected if not provided) work_dir: Working directory for temporary branches (default: auto in /tmp) report_file: File to write validation report to (default: stdout) chang

(
        self,
        git_root: Optional[Path] = None,
        work_dir: Optional[Path] = None,
        report_file: Optional[Path] = None,
        changelog_file: Optional[Path] = None,
        fetch_remote: bool = False,
        report_format: str = "md",
        skip_sync_check: bool = False,
        check_duplicates: bool = False,
    )

Source from the content-addressed store, hash-verified

71 """Main validator for Solr changelog structure."""
72
73 def __init__(
74 self,
75 git_root: Optional[Path] = None,
76 work_dir: Optional[Path] = None,
77 report_file: Optional[Path] = None,
78 changelog_file: Optional[Path] = None,
79 fetch_remote: bool = False,
80 report_format: str = "md",
81 skip_sync_check: bool = False,
82 check_duplicates: bool = False,
83 ):
84 """Initialize the validator.
85
86 Args:
87 git_root: Root of git repository (auto-detected if not provided)
88 work_dir: Working directory for temporary branches (default: auto in /tmp)
89 report_file: File to write validation report to (default: stdout)
90 changelog_file: File to write generated CHANGELOG.md to. (default: none)
91 fetch_remote: If True, fetch from remote.
92 report_format: Report format ("md" for Markdown or "json" for JSON)
93 skip_sync_check: If True, skip git branch sync check
94 check_duplicates: If True, check for duplicate JIRA issues (default: False)
95 """
96 if git_root is None:
97 git_root = self._find_git_root()
98 self.git_root = git_root
99 self.changelog_root = git_root / "changelog"
100 self.build_gradle = git_root / "build.gradle"
101 self.changelog_md = git_root / "CHANGELOG.md"
102 self.report_file = report_file
103 self.changelog_file = changelog_file
104 self.work_dir = work_dir
105 self.fetch_remote = fetch_remote
106 self.report_format = report_format
107 self.skip_sync_check = skip_sync_check
108 self.check_duplicates = check_duplicates
109 self.branches = {}
110 self.remote_branches = set()
111 self.errors = []
112 self.warnings = []
113 self.info_messages = []
114 self.current_branch = None
115 self.temp_branch = None
116
117 @staticmethod
118 def _find_git_root() -> Path:

Callers

nothing calls this directly

Calls 2

_find_git_rootMethod · 0.95
setFunction · 0.50

Tested by

no test coverage detected