Should we allow Configuration to parse a local repository config?#1042
Conversation
|
Would you need to do a breaking change? Why not have a named constructor which would make sure ther's a repo at |
|
@carlosmn even if we make this method |
|
Well, don't do that? If you do that you're ignoring the documentation which says that's a named constructor plus your IDE telling you it's a static method and you should not use an instance to refer to it. |
There's no such thing in C#
It's perfectly valid to call a static method from an instance
I think very few people actually read the documentation. Most of them rely on intellisense and try-outs.
I may indeed have little faith in humanity... |
seconded. |
|
@nulltoken, I think you might be confusing static methods with extension methods here. For your code example above to be valid,
but if you do it this way instead:
the method would work as @carlosmn proposes with no intellisense confusion. |
6edfe44 to
76e88dd
Compare
|
So, I did this thing.... which is now ready for review. |
a0c2c9c to
b03c9d1
Compare
There was a problem hiding this comment.
when does this have to be normalized? Could we have a single expected format for the incoming config file location?
There was a problem hiding this comment.
This probing was added because @ethomson mentioned once that it might be interesting to not being compelled to pass the full path to the config.
As such, it would accept a working directory, a bare repository folder or a full path to a known config file.
If this is no longer required, I can easily remove it.
|
👍 I think this looks good! |
|
Note to self: drop the |
b03c9d1 to
ca4d15e
Compare
Should we allow Configuration to parse a local repository config?
|
Published as NuGet pre-release package |
@shiftkey in #1031 made an amazing job getting rid of the optional parameters in favor of overloads. While taking a look at the changes in Configuration, I wondered if there was a use case where one would need to access the config of a repository without instantiating it.
Should this need be fulfilled, we'd rather make it happen in v0.22 as it will be quite a nasty breaking change.
/cc @jamill @ethomson