mathnet / mathnet-spatial

Math.NET Spatial
http://spatial.mathdotnet.com
MIT License
376 stars 132 forks source link

StyleCop contradicting rule #164

Closed Isitar closed 5 years ago

Isitar commented 5 years ago

You have a contradicting rule: SA1009: Closing paranthesis must be followed by a space. and SA1015: Closing generic bracket must not be preceded by a space. in combinations with generic value-tuples.

Example: var x = new List<(double x, double y)>

There is no way to write this statement without getting a Warning I think you didn't consider value tuples at all in your rules because I don't think public (double x, double y) someFunc() ... should be written public(double x, double y) someFunc() ... or value deconstruction: var (x, y) = someFunc(); needs to be written var(x, y) = someFunc();. All this is because of rule SA1008 Opening parenthesis must not be preceded by a space.

And there is another error in it which causes a real error: SA1101: Prefix local calls with this

I don't know why it pops up in this situation but here is the code:

var abc = (a: "hello", b: "world");

It sais I need to prefix a and b with this, but these are not fields, these are tuple value names

JohanLarsson commented 5 years ago

It is unfortunate that the package was published with a dependency on Stylecop see #161 The dependency will be removed, in the meantime you can suppress the Stylecop warnings using .ruleset. Sorry about the inconvenience.

Isitar commented 5 years ago

But stylecop is here for development right? I guess this problem will occour in the future when you use value-tuples for any function developing for mathnet-spatial

JohanLarsson commented 5 years ago

Ah, ok, yes we opted in to use StyleCop for the code in this library to have things consistent. What I meant is that it was a mistake to publish the package with a dependency as our library should not force opinionated formatting on consuming applications.

Should we reopen this issue?

Isitar commented 5 years ago

I think the issue should be reopened since it's a config bug that should be adressed to improve further development

MichaelBar1975 commented 5 years ago

Are there plans to release a new package version without StyleCop?

JohanLarsson commented 5 years ago

We should release a new version as soon as possible. We need help from @cdrnet with releasing.

cdrnet commented 5 years ago

Is this resolved with v0.5.0-beta05?

JohanLarsson commented 5 years ago

Yes, look like there is no longer a package dependency.

SkinnySackboy commented 5 years ago

Hi all! By any chance do we know when this beta package will be released as an official version?