Skip to content
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

refactor: Make non-API funcs private #327

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions capella/setup/setup_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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')"
Expand All @@ -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",
Expand All @@ -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()