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

Another stable build of v2 #38

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Another stable build of v2 #38

wants to merge 61 commits into from

Conversation

CreepPork
Copy link
Member

No description provided.

@CreepPork CreepPork self-assigned this Jan 3, 2019
@CreepPork CreepPork requested review from Kexanone and a user January 3, 2019 17:25
@CreepPork CreepPork requested review from neilzar and removed request for Kexanone and a user January 8, 2019 19:33
if (project.ProjectDirectory != path)
{
project = null;
}
Copy link

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

Copy link
Member Author

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;
}
Copy link

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;

Copy link
Member Author

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:

  1. It can sometimes confuse readers
  2. Code maintainability decreases as removing a simple space breaks the code
  3. Codacy complains about not having the full style
  4. Creating inconsistencies between different if statements.

Copy link

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;
}
Copy link

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.");
Copy link

@neilzar neilzar Jan 9, 2019

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.");

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants