-
Notifications
You must be signed in to change notification settings - Fork 525
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
Some improvements #3090
Some improvements #3090
Conversation
if checkCredentials (url, Some auth) then | ||
Some auth | ||
else | ||
failwithf "Credentials from authentication store for %s are invalid" source |
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.
Note that this still fails, but a bit later and with one request less
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) |
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.
that's a weird technique. throwing in defaultWith!? Seriously?
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.
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 ;)
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.
Honestly, I "default" "with" an error message. It doesn't even sound too bad. Is the code better with a match
?
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 |
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.
please don't use printfn directly. tracefn all the things
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.
Ok, but but just to make it clear: This is in fact program output no logging
@@ -776,6 +794,7 @@ let handleCommand silent command = | |||
| GenerateLoadScripts r -> processCommand silent generateLoadScripts r | |||
| GenerateNuspec r -> processCommand silent generateNuspec r | |||
| Why r -> processCommand silent why r | |||
| Restriction r -> processCommand silent restriction r |
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.
@forki I can remove that from the PR if you don't like it, the rest are bug-fixes
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.
no it's fine, but needs docs
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.
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)
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'll add some lines :)
docs/content/commands/restriction.md
Outdated
@@ -0,0 +1,36 @@ | |||
# paket why |
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.
oh :)
it's red. |
@@ -89,7 +89,7 @@ | |||
</When> | |||
</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')"> |
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'm not sure what this PR has to do with this change. but it looks correct?
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.
yes guess so
So I got it green finally? |
no it did not. yet |
No description provided.