Skip to content

Simplify command - #152

Merged
forki merged 11 commits into
fsprojects:masterfrom
theimowski:simplify_command
Sep 23, 2014
Merged

forki merged 11 commits into
fsprojects:masterfrom
theimowski:simplify_command

Conversation

@theimowski

Copy link
Copy Markdown
Member

for the moment I didn't have better idea how to shrink the contents of dependencies.file but to filter lines where a package name belongs to the set of indirect packages.
this probably needs more test cases and docs and stuff

@bartelink

Copy link
Copy Markdown
Member

Cool man! I know I bang on about it but have you seen #123; it makes sense for any item that doesn't have a parent in the set to be removed (but I assume that's obvious to you!) ?

@forki

forki commented Sep 22, 2014

Copy link
Copy Markdown
Member

tumblr_inline_mu9lwrzqhw1raprkq

@forki forki mentioned this pull request Sep 22, 2014
Comment thread src/Paket/Constants.fs Outdated

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.

Can please call it DependenciesFile?

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.

yeah, lazy me

Comment thread src/Paket/Simplifier.fs Outdated

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.

we should probably scan the code for "paket.references" and put it into Constants. Can you do this too? Thanks

@theimowski

Copy link
Copy Markdown
Member Author

@bartelink the alg is to remove all entries that are dependent on direct packages (directly or indirectly) 👯

Comment thread src/Paket/Simplifier.fs

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.

do we already have Save() method on the DependenciesFile?
Could take good use of this in Add command.

@bartelink

Copy link
Copy Markdown
Member

@theimowski Can't say I've thought about it much, but that seems to make sense.

Again, probably a silly question, not looking at the code, just guessing: if there's a rule that says that if the deps file has a rule that differs in any way from package = ver where ver is the version that the analysis determined?

Yet another silly question, have you considered adding FsCheck based tests specifying your algorithm (it can be mindbending but ultimately there can be no better validation IMO) ?

Finally, as a general point (I know there are other ones about and you prob didnt put them there), but I don't understand what the ToLowers etc. are about - for me those should always be case-insensitive compares ?

Will hopefully get around to some sanify checking in coming days - wont happen today :(

@theimowski

Copy link
Copy Markdown
Member Author

Again, probably a silly question, not looking at the code, just guessing: if there's a rule that says that if the deps file has a rule that differs in any way from package = ver where ver is the version that the analysis determined?

I ignored versions in the depfile. I base all dependencies on a lock file, so I made an assumption that there is no conflict.

Yet another silly question, have you considered adding FsCheck based tests specifying your algorithm (it can be mindbending but ultimately there can be no better validation IMO) ?

Yeah, that would be nice to have. Probably deserves a separate issue ?

Finally, as a general point (I know there are other ones about and you prob didnt put them there), but I don't understand what the ToLowers etc. are about - for me those should always be case-insensitive compares ?

i lowercase everything that comes from dep and ref files to prevent any case-sensitivity issues, but the output casing is untouched. If someone specified nuget fAkE 3.3.0 it will remain fAkE after simplification

@bartelink

Copy link
Copy Markdown
Member

ignored versions in the depfile. I base all dependencies on a lock file, so I made an assumption that there is no conflict.

That's fair enough - such an extension could easily be a new feature. I'm imagining running it 'just for kicks' but it 'considering' any 'pinning rules' I have and leaving them there as a vauge thing...

Yet another silly question, have you considered adding FsCheck based tests specifying your algorithm (it can be mindbending but ultimately there can be no better validation IMO) ?

Yeah, that would be nice to have. Probably deserves a separate issue ?

IMO Whether you're happy the code covers the cases can either be because you trust your coverage from a logical point of view and/or have confidence someone else has similarly triangulated across all the tests. I would not consider it a "top level feature" of a piece of software that it "has FsCheck"TM if you know what I mean.

Finally, as a general point (I know there are other ones about and you prob didnt put them there), but I don't understand what the ToLowers etc. are about - for me those should always be case-insensitive compares ?

i lowercase everything that comes from dep and ref files to prevent any case-sensitivity issues, but the output casing is untouched. If someone specified nuget fAkE 3.3.0 it will remain fAkE after simplification

Sounds like that's fair. I reckon over time we need a general package id abstraction, the equality of which should be insensitive. I don't think it has a material effect on this PR (and it would be bad to mangle it in - that def would be a separate Issue :)

@forki
forki merged commit c815804 into fsprojects:master Sep 23, 2014
@theimowski
theimowski deleted the simplify_command branch September 23, 2014 07:52
@forki

forki commented Sep 23, 2014

Copy link
Copy Markdown
Member

image

oupsi ;-)

@theimowski

Copy link
Copy Markdown
Member Author

whoa, that was silly of me 👎 Shall I fix it, or you already have hands on it?

@forki

forki commented Sep 23, 2014

Copy link
Copy Markdown
Member

fixed it.

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