From 3f297517fa10c7f892a62ec00f008d217ed32274 Mon Sep 17 00:00:00 2001 From: Jamil RAICHOUNI Date: Fri, 11 Oct 2024 04:43:50 +0200 Subject: [PATCH] refactor: Make non-API funcs private This makes clear, that these funcs are never called from somewhere outside of the present module. --- capella/setup/setup_workspace.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/capella/setup/setup_workspace.py b/capella/setup/setup_workspace.py index eac967b6..97f60028 100644 --- a/capella/setup/setup_workspace.py +++ b/capella/setup/setup_workspace.py @@ -17,7 +17,7 @@ ) -def replace_config(path: pathlib.Path, key: str, value: str) -> None: +def _replace_config(path: pathlib.Path, key: str, value: str) -> None: """Replace the existing config or add the config option.""" path.parent.mkdir(exist_ok=True, parents=True) if path.exists(): @@ -39,7 +39,7 @@ def replace_config(path: pathlib.Path, key: str, value: str) -> None: path.write_text(file_content) -def set_git_merge_mode() -> None: +def _set_git_merge_mode() -> None: """Set the default merge mode for Git to 'Last head (unmerged)'. The default merge strategy is set to "Working tree (pre-merged to 'Ours')" @@ -52,7 +52,7 @@ def set_git_merge_mode() -> None: MacOS: Capella > Settings > Version Control (Team) > Git > Diff/Merge > Merge tool content Linux: Windows > Preferences > Version Control (Team) > Git > Merge tool content """ - replace_config( + _replace_config( ECLIPSE_SETTINGS_BASE_PATH / "org.eclipse.egit.ui.prefs", "merge_mode", "2", @@ -61,17 +61,17 @@ def set_git_merge_mode() -> None: if __name__ == "__main__": # Disable Welcome Screen - replace_config( + _replace_config( ECLIPSE_SETTINGS_BASE_PATH / "org.eclipse.ui.prefs", "showIntro", "false", ) # Set default EGit path to /workspace/git - replace_config( + _replace_config( ECLIPSE_SETTINGS_BASE_PATH / "org.eclipse.egit.core.prefs", "core_defaultRepositoryDir", f"{WORKSPACE_DIR}/git", ) - set_git_merge_mode() + _set_git_merge_mode()