Skip to content

Some improvements - #3090

Merged
forki merged 13 commits into
masterfrom
some_improvements
Feb 28, 2018
Merged

forki merged 13 commits into
masterfrom
some_improvements

Conversation

@matthid

@matthid matthid commented Feb 27, 2018

Copy link
Copy Markdown
Member

No description provided.

if checkCredentials (url, Some auth) then
Some auth
else
failwithf "Credentials from authentication store for %s are invalid" source

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note that this still fails, but a bit later and with one request less

@forki forki mentioned this pull request Feb 28, 2018
let inline getPackageIdAttribute (pf:ProjectFile) (node:XmlNode) =
node |> getAttribute "Include"
|> Option.orElseWith (fun _ -> node |> getAttribute "Update")
|> Option.defaultWith (fun _ -> failwithf "project file '%s' contains a reference without 'Include' or 'Update' attribute" pf.FileName)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that's a weird technique. throwing in defaultWith!? Seriously?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What else do you suggest? The only thing it does: Give a better error message in case all other cases fail and defaultWith has the signature I need for this here ;)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Honestly, I "default" "with" an error message. It doesn't even sound too bad. Is the code better with a match?

Comment thread src/Paket/Program.fs Outdated
for problem in parseProblems |> Seq.map (fun x -> x.AsMessage) do
Logging.traceWarnfn "Problem: %s" problem

printfn "Restriction: %s" restrictionRaw

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please don't use printfn directly. tracefn all the things

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, but but just to make it clear: This is in fact program output no logging

Comment thread src/Paket/Program.fs
| GenerateLoadScripts r -> processCommand silent generateLoadScripts r
| GenerateNuspec r -> processCommand silent generateNuspec r
| Why r -> processCommand silent why r
| Restriction r -> processCommand silent restriction r

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@forki I can remove that from the PR if you don't like it, the rest are bug-fixes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no it's fine, but needs docs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's the question, I saw it more like a debug helper for us, but we can make it a feature (honestly I doubt if the regular user can do something with the output)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll add some lines :)

Comment thread docs/content/commands/restriction.md Outdated
@@ -0,0 +1,36 @@
# paket why

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oh :)

@forki

forki commented Feb 28, 2018

Copy link
Copy Markdown
Member

it's red.
anc can you please merge master?

</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3')">

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure what this PR has to do with this change. but it looks correct?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes guess so

@forki
forki merged commit b63178e into master Feb 28, 2018
@forki
forki deleted the some_improvements branch February 28, 2018 15:17
@matthid

matthid commented Feb 28, 2018

Copy link
Copy Markdown
Member Author

So I got it green finally?

@forki

forki commented Feb 28, 2018

Copy link
Copy Markdown
Member

no it did not. yet

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.

2 participants