-
Notifications
You must be signed in to change notification settings - Fork 1
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
Another stable build of v2 #38
base: master
Are you sure you want to change the base?
Conversation
I can't be bothered to split the commits into proper ones
…mizations and refactorings
if (project.ProjectDirectory != path) | ||
{ | ||
project = null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be replaced with if (project.ProjectDirectory != path) return null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think the return statement worked in the if statement.
if (! ConsoleUtility.AskYesNoQuestion("Rebuild?")) | ||
{ | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be written as if (! ConsoleUtility.AskYesNoQuestion("Rebuild?")) return 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deliberately avoided this for the following reasons:
- It can sometimes confuse readers
- Code maintainability decreases as removing a simple space breaks the code
- Codacy complains about not having the full style
- Creating inconsistencies between different if statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least remove the {}
in that case, you don't need those when there is only a single line in the if statement. And I have a distaste for it as it is more difficult to read.
internal static void Handle(string[] arguments) | ||
{ | ||
// In case no arguments were given, then return back to Program class. | ||
if (arguments.Length != 1) | ||
{ | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be written as if (arguments.Length != 1) return;
Console.WriteLine(" init Initiate a new Hephaestus project at your current CD location."); | ||
Console.WriteLine(" force Force build a project ignoring all checksums."); | ||
Console.WriteLine(" version Show Hephaestus version."); | ||
Console.WriteLine(" help Display this again."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than multiple WriteLine, you can do it with one.
Can be done with either
Console.WriteLine(@"Usage:
Launching with no commands will initiate building of your current project (if present).
init etcetcetc.");
or
Console.WriteLine("Usage:\n" +
" Launching with no commands will initiate building of your current project (if present).\n" +
" init etcetcetc.");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d prefer the first option as it’s cleaner and doesn’t add all the string concatenation pluses.
No description provided.