Code quality improvements#261
Merged
olehermanse merged 7 commits intoJul 24, 2025
Merged
Conversation
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…on code Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
This improves modularity (useful in case Git initialization needs to also be done elsewhere), and helps deflate the currently overgrown `commands.py` file Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
…inting and returning 0 or 1 Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
c369b45 to
79933af
Compare
olehermanse
approved these changes
Jul 24, 2025
olehermanse
left a comment
Member
There was a problem hiding this comment.
Looks good overall, just some smaller comments.
Comment on lines
+66
to
+71
| def yesno_to_bool(s: str): | ||
| if s == "yes": | ||
| return True | ||
| if s == "no": | ||
| return False | ||
| assert False |
Member
There was a problem hiding this comment.
Suggested change
| def yesno_to_bool(s: str): | |
| if s == "yes": | |
| return True | |
| if s == "no": | |
| return False | |
| assert False | |
| def yesno_to_bool(s: str): | |
| assert s in ("yes", "no") | |
| return s == "yes" |
| raise CFBSUserError("Already initialized - look at %s" % cfbs_filename()) | ||
|
|
||
| name = prompt_user( | ||
| project_name = prompt_user( |
Member
There was a problem hiding this comment.
This one is very subjective. I thought it was nicer before when name matched the name field, same as description, but not a big deal.
Comment on lines
+142
to
+148
| if not is_git_repo(): | ||
| git_init(user_name, user_email, description) | ||
| else: | ||
| if not git_set_config("user.name", user_name) or not git_set_config( | ||
| "user.email", user_email | ||
| ): | ||
| raise CFBSExitError("Failed to set Git user name and email") |
Member
There was a problem hiding this comment.
Could have used early return and avoided a bit of indentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.