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

Changed NoDescription to target.Name. Updated links to use HTTPS per … #1996

Merged
merged 8 commits into from
Jul 1, 2018
Merged

Conversation

zakaluka
Copy link

…GitHub changes.

For #1993

@matthid
Copy link
Member

matthid commented Jun 13, 2018

Which output are you referring to? Because afaik we first print the target name and then on the next line the description.
With this change we now print the target name twice.

The relevant place is:

https://github.com/fsharp/FAKE/blob/fe316d3355e93b116e9536ad261ecc292d706554/src/app/Fake.Core.Trace/TraceListener.fs#L246-L250

Maybe in your change we just use null which will skip printing?

@matthid
Copy link
Member

matthid commented Jun 13, 2018

Btw: Thanks for your first contribution!

@zakaluka
Copy link
Author

zakaluka commented Jun 14, 2018

After reading your response, I see that you are right! However, at least in Ionide on Windows 7, here's what it looks like:

image

The description is quite prominent and helps break up the different targets and the visual flow, whereas the Start target 'XYZ' looks like any other text and is difficult to notice at a glance.

Putting a null may make more sense, but maybe possibly even better would be to emphasize the line Starting target ... instead of the description.

EDIT: The alternative may be that I just need a better console / terminal, in which case null might make the most sense.

EDIT2: Running FAKE on the latest git-bash on Windows results in no color being displayed at all (I assume because it doesn't recognize the terminal as supporting colors, even though it does)

EDIT3: For every shell I've tried on Windows 7, the coloring stays consistent as shown above. I still believe that emphasizing the target.Name makes more sense because you are guaranteed to have a Name whereas the Description is optional.

@matthid
Copy link
Member

matthid commented Jun 17, 2018

@zakaluka I'm open to changes there, feel free to play around and send something you are happy with :)

@zakaluka
Copy link
Author

The latest version has 2 changes in total:

  • Return null if there is no description
  • If there is a description, print it to the right of the target, after a colon :

@zakaluka
Copy link
Author

@matthid I think I've gone as far as is needed to get the output a little better. (surprisingly small amount of change)

I'm still seeing outputs of "NoDescription" in the tests, but can't figure out where they are coming from. That string doesn't occur anywhere in my codebase. If you have any insight, would love to fix it.

Copy link
Member

@matthid matthid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some very very pedantic minor things left ;)

@@ -110,7 +110,7 @@ type TagStatus =

/// Defines Tracing information for TraceListeners
[<RequireQualifiedAccess>]
type TraceData =
type TraceData =
| ImportData of typ:ImportData * path:string
| BuildNumber of text:string
| ImportantMessage of text:string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment to OpenTag that description might be null in case it is missing (which is probably the best we can do for now, ideally we would change to string option but I don't want to make that breaking change here.

let msg = TraceData.TraceMessage("", true)
let color2 = colorMap msg
write false color2 false (sprintf "Starting %s '%s'" tag.Type tag.Name)
if not (String.IsNullOrWhiteSpace description) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not leave isNull?

Note that the current solution has a small problem when using --parallel. The "newlinecharacter might be printed after another target description (ie you have something likeStarting T1 T1Starting T2 T2: descriptionT1: description T2` followed by two newline characters). It's probably not a huge deal, but if we use the same color anyway we should probably create the string and use a single write with newline character here.

@matthid
Copy link
Member

matthid commented Jun 29, 2018

Regarding the tests: I think the output might come from testing the legacy fake version, which is fine (we don't really want to update that one).

@matthid
Copy link
Member

matthid commented Jul 1, 2018

Ok let me finish this. Again thanks!

@matthid matthid merged commit 18440b4 into fsprojects:release/next Jul 1, 2018
matthid added a commit that referenced this pull request Jul 1, 2018
@matthid matthid mentioned this pull request Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants