You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fix line length issues (E501) in CLI modules
- Replace open() with Path.open() (PTH123)
- Remove redundant exception objects in logging.exception() calls (TRY401)
- Break long strings across multiple lines for better readability
- All ruff and mypy checks now pass for the new CLI commands
).name# if target_path is specified, use its name for repo_name
109
116
else:
110
117
repo_name=repo_name_or_url
111
-
# URL is not provided, for now, we can make it an error or set a placeholder
112
-
# In future, could try to infer from a local git repo if target_path_str points to one
118
+
# URL is not provided, for now, we can make it an error or set a
119
+
# placeholder. In future, could try to infer from a local git repo if
120
+
# target_path_str points to one
113
121
log.error(
114
-
"Repository URL must be provided if repo_name_or_url is not a URL. Functionality to infer URL is not yet implemented.",
122
+
"Repository URL must be provided if repo_name_or_url is not a URL. "
123
+
"Functionality to infer URL is not yet implemented.",
115
124
)
116
-
# For now, let's assume a placeholder or require URL to be part of repo_name_or_url
117
-
# This part needs a decision: either make URL mandatory with name, or implement inference
118
-
# Let's require the user to provide a URL for now by just using repo_name_or_url as URL if it seems like one
119
-
# This means the first arg must be a URL if only one arg is given and it's not just a name.
120
-
# To simplify, let's assume if not detected as URL, then it's just a name and we need target_path to be a URL
121
-
# Or, the user *must* provide two arguments: name then url. The current subparser takes one `repo_name_or_url` and optional `target_path`.
122
-
# This argument parsing needs refinement in `create_add_subparser` to accept name and url separately.
123
-
# For now, this will likely fail if a plain name is given without a clear URL source.
124
-
# Let's adjust the expectation: repo_name_or_url IS THE URL, and repo_name is derived or taken from target_path.
125
-
# This means first arg is always URL-like or repo name. Second is target_path (which becomes name)
126
-
127
-
# Re-evaluating argument strategy based on user request for `vcspull add my-repo <url>`:
128
-
# `repo_name_or_url` will be `my-repo`
129
-
# `target_path` will be `<url>`
130
-
# This means `create_add_subparser` needs adjustment.
131
-
# For now, let's proceed with the current subparser and assume `repo_name_or_url` is the name, and `target_path` (if provided) is the URL for this specific case.
132
-
# This is getting complicated. Let's simplify the add command for now:
133
-
# `vcspull add <NAME> <URL>`
125
+
# For now, let's assume a placeholder or require URL to be part of
126
+
# repo_name_or_url. This part needs a decision: either make URL mandatory
127
+
# with name, or implement inference. Let's require the user to provide a
128
+
# URL for now by just using repo_name_or_url as URL if it seems like one.
129
+
# This means the first arg must be a URL if only one arg is given and it's
130
+
# not just a name. To simplify, let's assume if not detected as URL, then
131
+
# it's just a name and we need target_path to be a URL. Or, the user
132
+
# *must* provide two arguments: name then url. The current subparser takes
133
+
# one `repo_name_or_url` and optional `target_path`. This argument parsing
134
+
# needs refinement in `create_add_subparser` to accept name and url
135
+
# separately. For now, this will likely fail if a plain name is given
136
+
# without a clear URL source. Let's adjust the expectation: repo_name_or_url
137
+
# IS THE URL, and repo_name is derived or taken from target_path. This means
138
+
# first arg is always URL-like or repo name. Second is target_path (which
139
+
# becomes name)
140
+
141
+
# Re-evaluating argument strategy based on user request for
142
+
# `vcspull add my-repo <url>`: `repo_name_or_url` will be `my-repo`
143
+
# `target_path` will be `<url>`. This means `create_add_subparser` needs
144
+
# adjustment. For now, let's proceed with the current subparser and assume
145
+
# `repo_name_or_url` is the name, and `target_path` (if provided) is the
146
+
# URL for this specific case. This is getting complicated. Let's simplify
147
+
# the add command for now: `vcspull add <NAME> <URL>`
134
148
# The current `repo_name_or_url` and `target_path` can be repurposed.
135
149
136
150
# Let's rename parser args for clarity: repo_name, repo_url
137
151
# This requires changing create_add_subparser and the cli call in __init__.py
138
-
# Given the current structure, repo_name_or_url = actual name, target_path = actual_url
152
+
# Given the current structure, repo_name_or_url = actual name,
153
+
# target_path = actual_url
139
154
iftarget_path_strisNone:
140
155
log.error("If first argument is a name, second argument (URL) is required.")
# This assumes target_path_str is the actual clone path if provided and is not the URL itself
156
-
# This logic is getting tangled due to the argument overloading. Let's stick to the idea that repo_name is derived or is first arg, url is second or inferred
157
-
# For simplicity, let's assume if base_dir_key is not given, we use a default or CWD based key
158
-
# This needs to be more robust. Example: if repo is to be cloned to /home/user/study/python/myrepo
169
+
# Infer from target_path_str if it's a local path. This assumes
170
+
# target_path_str is the actual clone path if provided and is not the URL
171
+
# itself. This logic is getting tangled due to the argument overloading.
172
+
# Let's stick to the idea that repo_name is derived or is first arg, url
173
+
# is second or inferred. For simplicity, let's assume if base_dir_key is
174
+
# not given, we use a default or CWD based key. This needs to be more
175
+
# robust. Example: if repo is to be cloned to /home/user/study/python/myrepo
159
176
# and vcspull.yaml has '~/study/python/': ..., then this is the key.
160
177
# We can use os.path.commonpath or iterate through existing keys.
161
-
# For now, default to current working directory's representation or a new top-level key if no match.
178
+
# For now, default to current working directory's representation or a new
0 commit comments