Enable fixes for W20 repeated keys - group them into attribute sets#163
Enable fixes for W20 repeated keys - group them into attribute sets#163jakob1379 wants to merge 1 commit intooppiliappan:masterfrom
Conversation
| - foo.bar = 1; | ||
| - foo.bar."hello" = 1; |
There was a problem hiding this comment.
Wait, shouldn't this fail to parse?
There was a problem hiding this comment.
In Nix itself this seems to be a parsing error. Should we even have such a test expression? It seems that rnix accepts this. Perhaps this is another reason to have a HIR.
There was a problem hiding this comment.
Okay, I have corrected this in master. Mind rebasing?
There was a problem hiding this comment.
Oh, wait, I thought that this was my fork but it's not!
| assert!( | ||
| !check_output.contains("Avoid repeated keys in attribute sets"), | ||
| "repeated_keys warning remained after fix\nfixed:\n{fixed}\ncheck output:\n{check_output}", | ||
| ); |
There was a problem hiding this comment.
Would you mind explaining in English what the problem is and what the strategy behind this solution is?
|
Would you mind submitting against https://github.com/molybdenumsoftware/statix ? |
thank you for the feedback! I will get to it all - but i see you have a fork, why should this be submitted there? |
|
I added a little near the top of the fork's readme about why I forked. Still hoping to unfork. |
What's stopping you, you can't contact the repo owner or? |
|
They seem to be reluctant to accept any of my suggestions towards unforking 😢 |
Disclaimer: This has been made in collaboration with t3code, but I have been in the code, testing it thoroughly on various nixpkgs, and other nix repos.
This should solve various issues related to #99 (comment) and the W20 (repeated keys) by finding the repeated keys and group them together:
If there are any funky business you do not like feel free to give feedback as I am still new to coding with Nix :)