oppiliappan / statix

lints and suggestions for the nix programming language
https://git.peppe.rs/languages/statix/about
MIT License
552 stars 21 forks source link

make eta_reduction less aggressive #76

Closed astro closed 1 year ago

astro commented 1 year ago

Hi! Thank you for this very useful tool.

I found the eta-reduction to be too aggressive for all cases, reducing code readability in complex lambda expressions. When there are more arguments to the call in the lambda body, explicit arguments indicate more useful information to the reader. My idea is to add a restriction that makes it only run for the most primitive expressions. Is that an idea worth pursuing?

The test fixture is a bit contrived. Real-world code can be more complex.

oppiliappan commented 1 year ago

hi, thanks for the PR, i think i do agree with the changes here, the reduced form leads to too much mental gymnastics sometimes.

oppiliappan commented 1 year ago

thanks for the contribution!