psalm-strict-equality icon indicating copy to clipboard operation
psalm-strict-equality copied to clipboard

Additional auto fixables

Open kkmuffme opened this issue 2 years ago • 8 comments

  • extends list of auto-fixable array/object types
  • auto-fix Unions where one side is string/union of strings
  • add generic equal class auto-fixables
  • auto-fix Unions where both sides contain only 1 atomic (sub)type
  • make docblock usage configurable via psalm config

Fix: https://github.com/orklah/psalm-strict-equality/issues/3

kkmuffme avatar Sep 12 '22 23:09 kkmuffme

Fix https://github.com/orklah/psalm-strict-equality/issues/6 now too (except for lists? since we kind of expect lists to have the same ordering, that's the whole reason why list is used, isn't it?)

kkmuffme avatar Sep 15 '22 09:09 kkmuffme

@orklah if you have a few mins I'd really appreciate some feedback on this

kkmuffme avatar Sep 19 '22 19:09 kkmuffme

Yeah sorry, it's on my list, I'll get to it soon

orklah avatar Sep 19 '22 20:09 orklah

Oh. I just realized you didn't see my first round of comments because I didn't publish them :( sorry. I thought you responded to it earlier but it was just a response to my new issue.

You'll see duplicate comments or outdated comments, you can resolve them directly

orklah avatar Sep 20 '22 08:09 orklah

Changed various things to handle more common cases and excluded things that won't work.

Overall works quite well, feedback appreciated so this can get merged eventually

kkmuffme avatar Dec 01 '22 12:12 kkmuffme

It's really became a complex piece of code. I'd be way more at ease if we could make some kind of automated check that everything is correct. Not necessarily a whole test suite, but some script we can run to check whether the plugin is doing its job

orklah avatar Dec 05 '22 19:12 orklah

I can add that eventually and merge it then, for now could you please merge https://github.com/orklah/psalm-strict-equality/pull/7 and release so the existing plugin can be used as is with psalm v5 at least?

kkmuffme avatar Dec 05 '22 19:12 kkmuffme

Done! Make sure to report any error while running it, the lack of tests on those plugins makes this kind of change random :p

orklah avatar Dec 05 '22 19:12 orklah